GroupBox.FlatStyle GroupBox.FlatStyle GroupBox.FlatStyle GroupBox.FlatStyle Property

Definición

Obtiene o establece la apariencia de estilo plano del control de cuadro de grupo.Gets or sets the flat style appearance of the group box control.

public:
 property System::Windows::Forms::FlatStyle FlatStyle { System::Windows::Forms::FlatStyle get(); void set(System::Windows::Forms::FlatStyle value); };
public System.Windows.Forms.FlatStyle FlatStyle { get; set; }
member this.FlatStyle : System.Windows.Forms.FlatStyle with get, set
Public Property FlatStyle As FlatStyle

Valor de propiedad

Uno de los valores de FlatStyle.One of the FlatStyle values. El valor predeterminado es Standard.The default value is Standard.

Excepciones

El valor asignado no es uno de los valores de FlatStyle.The value assigned is not one of the FlatStyle values.

Ejemplos

En el ejemplo de código siguiente se crea una instancia y se crea un GroupBox y dos RadioButton controles.The following code example instantiates and creates a GroupBox and two RadioButton controls. Los botones de opción (también conocido como botones de radio) se agregan al cuadro de grupo y el cuadro de grupo se agrega a la Form.The option buttons (also known as radio buttons) are added to the group box and the group box is added to the Form.

private void InitializeMyGroupBox()
{
    // Create and initialize a GroupBox and a Button control.
    GroupBox groupBox1 = new GroupBox();
    Button button1 = new Button();
    button1.Location = new Point(20,10);

    // Set the FlatStyle of the GroupBox.
    groupBox1.FlatStyle = FlatStyle.Flat;

    // Add the Button to the GroupBox.
    groupBox1.Controls.Add(button1);

    // Add the GroupBox to the Form.
    Controls.Add(groupBox1);

    // Create and initialize a GroupBox and a Button control.
    GroupBox groupBox2 = new GroupBox();
    Button button2 = new Button();
    button2.Location = new Point(20, 10);
    groupBox2.Location = new Point(0, 120);

    // Set the FlatStyle of the GroupBox.
    groupBox2.FlatStyle = FlatStyle.Standard;

    // Add the Button to the GroupBox.
    groupBox2.Controls.Add(button2);

    // Add the GroupBox to the Form.
    Controls.Add(groupBox2);
}
 
Private Sub InitializeMyGroupBox()
   ' Create and initialize a GroupBox and a Button control.
        Dim groupBox1 As New GroupBox()
        Dim button1 As New Button()
        button1.Location = New Point(20, 10)

        ' Set the FlatStyle of the GroupBox.
        groupBox1.FlatStyle = FlatStyle.Flat

        ' Add the Button to the GroupBox.
        groupBox1.Controls.Add(button1)

        ' Add the GroupBox to the Form.
        Controls.Add(groupBox1)

        ' Create and initialize a GroupBox and a Button control.
        Dim groupBox2 As New GroupBox()
        Dim button2 As New Button()
        button2.Location = New Point(20, 10)
        groupBox2.Location = New Point(0, 120)

        ' Set the FlatStyle of the GroupBox.
        groupBox2.FlatStyle = FlatStyle.Standard

        ' Add the Button to the GroupBox.
        groupBox2.Controls.Add(button2)

        ' Add the GroupBox to the Form.
        Controls.Add(groupBox2)
End Sub 

Comentarios

Un GroupBox con un FlatStyle valor System no recibe los eventos del mouse.A GroupBox with a FlatStyle value of System does not receive mouse events.

Se aplica a

Consulte también: