다음을 통해 공유


RadioButton.AutoCheck 속성

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

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

구문

‘선언
Public Property AutoCheck As Boolean
‘사용 방법
Dim instance As RadioButton
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 값과 컨트롤의 모양이 자동으로 변경되면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

설명

Checked 값이 false로 설정되어 있으면 Click 이벤트 처리기의 코드에서 컨트롤의 RadioButton 부분을 선택해야 합니다. 또한 RadioButtonRadioButton 컨트롤 그룹의 일부인 경우 한 번에 하나의 컨트롤만 선택할 수 있습니다.

AutoCheck 속성이 false로 설정되면 RadioButton 컨트롤 그룹을 다른 컨트롤과 함께 사용될 수 있으며 코드에서 Checked 속성을 업데이트해야 합니다.

예제

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

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
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 void InitializeMyRadioButton()
{
    // Create and initialize a new RadioButton. 
    RadioButton radioButton1 = new RadioButton();

    // Make the radio button control appear as a toggle button.
    radioButton1.set_Appearance(Appearance.Button);

    // Turn off the update of the display on the click of the control.
    radioButton1.set_AutoCheck(false);
    
    // Add the radio button to the form.
    get_Controls().Add(radioButton1);
} //InitializeMyRadioButton

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, 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에서 지원

참고 항목

참조

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