This documentation is archived and is not being maintained.

RadioButton.Appearance Property

Gets or set the value that determines the appearance of the radio button 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 assigned value is not one of the Appearance values.

Remarks

If the Appearance value is set to Normal, then the RadioButton control is drawn with a circular check box. If the value is set to Appearance.Button, then the RadioButton control is drawn as a button that can be toggled to an up or down state. Either type can display text, an image, or both.

Example

[Visual Basic, C#, C++] The following example creates and initializes a RadioButton, gives it the appearance of a toggle button, sets its AutoCheck property to false, and adds it to a Form.

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


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


[C++] 
private:
    void InitializeMyRadioButton() {
        // Create and initialize a new RadioButton. 
        RadioButton __gc *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);
    };

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

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

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

Show: