다음을 통해 공유


CheckBox.Appearance 속성

CheckBox 컨트롤의 모양을 결정하는 값을 가져오거나 설정합니다.

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

구문

‘선언
<LocalizableAttribute(True)> _
Public Property Appearance As Appearance
‘사용 방법
Dim instance As CheckBox
Dim value As Appearance

value = instance.Appearance

instance.Appearance = value
[LocalizableAttribute(true)] 
public Appearance Appearance { get; set; }
[LocalizableAttribute(true)] 
public:
property Appearance Appearance {
    Appearance get ();
    void set (Appearance value);
}
/** @property */
public Appearance get_Appearance ()

/** @property */
public void set_Appearance (Appearance value)
public function get Appearance () : Appearance

public function set Appearance (value : Appearance)

속성 값

Appearance 값 중 하나입니다. 기본값은 Normal입니다.

예외

예외 형식 조건

InvalidEnumArgumentException

할당된 값이 Appearance 값 중 하나가 아닌 경우

설명

Appearance 값을 Normal로 설정하면 해당 CheckBox는 일반 모양으로 표시되며 값을 Button으로 설정하면 해당 CheckBox는 up 또는 down 상태로 전환할 수 있는 토글 단추와 유사한 모양으로 표시됩니다.

예제

다음 코드 예제에서는 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에서 지원

참고 항목

참조

CheckBox 클래스
CheckBox 멤버
System.Windows.Forms 네임스페이스
Appearance 열거형