CheckBox.AutoCheck 속성

정의

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

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

속성 값

true Checked 이벤트에서 컨트롤의 값이나 CheckState 값 및 모양이 자동으로 변경 Click 되면 이고, false그렇지 않으면 . 기본값은 true입니다.

예제

다음 코드 예제에서는 토글 단추를 만들고 초기화 CheckBox하고 토글 단추 AutoCheck 의 모양을 지정하고 설정하여 false에 추가합니다 Form.

public:
   void InstantiateMyCheckBox()
   {
      // Create and initialize a CheckBox.   
      CheckBox^ checkBox1 = gcnew CheckBox;
      
      // Make the check box control appear as a toggle button.
      checkBox1->Appearance = Appearance::Button;
      
      // Turn off the update of the display on the click of the control.
      checkBox1->AutoCheck = false;
      
      // Add the check box control to the form.
      this->Controls->Add( checkBox1 );
   }
public void InstantiateMyCheckBox()
 {
    // Create and initialize a CheckBox.   
    CheckBox checkBox1 = new CheckBox(); 
    
    // Make the check box control appear as a toggle button.
    checkBox1.Appearance = Appearance.Button;
 
    // Turn off the update of the display on the click of the control.
    checkBox1.AutoCheck = false;
 
    // Add the check box control to the form.
    Controls.Add(checkBox1);
 }
Public Sub InstantiateMyCheckBox()
    ' Create and initialize a CheckBox.   
    Dim checkBox1 As New CheckBox()
    
    ' Make the check box control appear as a toggle button.
    checkBox1.Appearance = Appearance.Button
    
    ' Turn off the update of the display on the click of the control.
    checkBox1.AutoCheck = False
    
    ' Add the check box control to the form.
    Controls.Add(checkBox1)
End Sub

설명

false로 설정된 경우 AutoCheck 이벤트 처리기의 값을 Checked 업데이트 CheckStateClick 하는 코드를 추가해야 합니다.

적용 대상