다음을 통해 공유


CheckBox.AutoCheck 속성

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

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Public Property AutoCheck As Boolean
‘사용 방법
Dim instance As CheckBox
Dim value As Boolean

value = instance.AutoCheck

instance.AutoCheck = value
public bool AutoCheck { get; set; }
public:
property bool AutoCheck {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_AutoCheck ()

/** @property */
public void set_AutoCheck (boolean value)
public function get AutoCheck () : boolean

public function set AutoCheck (value : boolean)

속성 값

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

설명

AutoCheck를 false로 설정한 경우 코드를 추가하여 Click 이벤트 처리기에 있는 Checked 또는 CheckState 값을 업데이트해야 합니다.

예제

다음 코드 예제에서는 CheckBox를 만들고 초기화한 후 토글 단추 모양으로 나타낸 다음 AutoCheckfalse로 설정하여 Form에 추가합니다.

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 'InstantiateMyCheckBox
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:
   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.set_Appearance(Appearance.Button);

    // Turn off the update of the display on the click of the control.
    checkBox1.set_AutoCheck(false);

    // Add the check box control to the form.
    get_Controls().Add(checkBox1);
} //InstantiateMyCheckBox
public function InstantiateMyCheckBox()
 {
    // Create and initialize a CheckBox.   
    var checkBox1 : CheckBox = 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);
 }
 

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

CheckBox 클래스
CheckBox 멤버
System.Windows.Forms 네임스페이스