RadioButton.AutoCheck 속성

정의

컨트롤을 클릭할 때 Checked 값과 컨트롤 모양이 자동으로 변경되는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool AutoCheck { bool get(); void set(bool value); };
public bool AutoCheck { get; set; }
member this.AutoCheck : bool with get, set
Public Property AutoCheck As Boolean

속성 값

Checked 이벤트가 발생할 때 Click 값과 컨트롤의 모양이 자동으로 변경되면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 코드 예제에서는 만들고 초기화 RadioButton합니다 토글 컨트롤의 모양을 제공 하 고 해당 AutoCheck 속성을 설정 하 false고 에 추가 합니다 Form.

private void InitializeMyRadioButton()
{
   // Create and initialize a new RadioButton.
   RadioButton radioButton1 = new RadioButton();

   // Make the radio button control appear as a toggle button.
   radioButton1.Appearance = Appearance.Button;

   // Turn off the update of the display on the click of the control.
   radioButton1.AutoCheck = false;

   // Add the radio button to the form.
   Controls.Add(radioButton1);
}
Private Sub InitializeMyRadioButton()
    ' Create and initialize a new RadioButton. 
    Dim radioButton1 As New RadioButton()
       
    ' Make the radio button control appear as a toggle button.
    radioButton1.Appearance = Appearance.Button
       
    ' Turn off the update of the display on the click of the control.
    radioButton1.AutoCheck = False
       
    ' Add the radio button to the form.
    Controls.Add(radioButton1)
End Sub

설명

값이 로 CheckedRadioButton 설정된 false경우 컨트롤의 부분을 이벤트 처리기의 코드에서 Click 확인해야 합니다. 또한 가 RadioButton 컨트롤 그룹의 일부 RadioButton 인 경우 이 속성은 지정된 시간에 컨트롤 중 하나만 확인하도록 합니다.

경우는 AutoCheck 속성으로 설정 false된 , 컨트롤의 RadioButton 그룹 상호 배타적 그룹 역할을 하지 않습니다 및 Checked 속성 코드에서 업데이트 해야 합니다.

적용 대상