This documentation is archived and is not being maintained.

CheckBox.Appearance Property

Gets or sets the value that determines the appearance of a check box control.

[Visual Basic]
Public Property Appearance As Appearance
[C#]
public Appearance Appearance {get; set;}
[C++]
public: __property Appearance get_Appearance();
public: __property void set_Appearance(Appearance);
[JScript]
public function get Appearance() : Appearance;
public function set Appearance(Appearance);

Property Value

One of the Appearance values. The default value is Normal.

Exceptions

Exception Type Condition
InvalidEnumArgumentException The value assigned is not one of the Appearance values.

Remarks

If Appearance value is set to Appearance.Normal, the check box has a typical appearance. If the value is set to Button, the check box appears like a toggle button, which can be toggled to an up or down state.

Example

The following example creates and initializes a CheckBox, gives it the appearance of a toggle button, sets AutoCheck to false, and adds it to a Form.

[Visual Basic] 
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

[C#] 
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);
 }
 

[C++] 
public:
    void InstantiateMyCheckBox() {
        // Create and initialize a CheckBox.   
        CheckBox __gc *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.
        this->Controls->Add(checkBox1);
    };
 

[JScript] 
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);
 }
 

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CheckBox Class | CheckBox Members | System.Windows.Forms Namespace | Appearance

Show: