GroupBox — отображает рамку вокруг группы элементов управления и, необязательно, заголовок над ней.
Form1.cs
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
namespace
WindowsFormsApplication1 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
groupBox1.Select();
-
}
-
private
void
radioButton1_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(255, 0, 0);
-
}
-
private
void
radioButton2_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 255, 0);
-
}
-
private
void
radioButton3_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 0, 255);
-
}
-
}
}
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Windows.Forms;
namespace
WindowsFormsApplication1 {
-
public
partial
class
Form1 : Form {
-
public
Form1() {
-
InitializeComponent();
-
groupBox1.Select();
-
}
-
private
void
radioButton1_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(255, 0, 0);
-
}
-
private
void
radioButton2_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 255, 0);
-
}
-
private
void
radioButton3_CheckedChanged(
object
sender, EventArgs e) {
-
textBox1.BackColor = Color.FromArgb(0, 0, 255);
-
}
-
}
}