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

정의

group box 컨트롤의 평면 스타일 모양을 가져오거나 설정합니다.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

속성 값

FlatStyle 값 중 하나입니다.One of the FlatStyle values. 기본값은 Standard입니다.The default value is Standard.

예외

할당된 값이 FlatStyle 값 중 하나가 아닌 경우The value assigned is not one of the FlatStyle values.

예제

다음 코드 예제를 인스턴스화하고 만듭니다는 GroupBox 두 개의 RadioButton 컨트롤입니다.The following code example instantiates and creates a GroupBox and two RadioButton controls. 옵션 단추 (라디오 단추 라고도 함)는 그룹 상자에 추가 되 고 그룹 상자에 추가 되는 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 

설명

A GroupBox 사용 하 여는 FlatStyle 의 값 System 마우스 이벤트를 수신 하지 않습니다.A GroupBox with a FlatStyle value of System does not receive mouse events.

적용 대상

추가 정보