Freigeben über


RadioButton.Appearance-Eigenschaft

Ruft einen Wert ab, der die Darstellung des RadioButton bestimmt, oder legt diesen fest.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Syntax

'Declaration
<LocalizableAttribute(True)> _
Public Property Appearance As Appearance
'Usage
Dim instance As RadioButton
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)

Eigenschaftenwert

Einer der Appearance-Werte. Der Standardwert ist Normal.

Ausnahmen

Ausnahmetyp Bedingung

InvalidEnumArgumentException

Der zugewiesene Wert ist keiner der Appearance-Werte.

Hinweise

Wenn der Appearance-Wert auf Normal festgelegt ist, wird das RadioButton-Steuerelement mit einem runden Kontrollkästchen gezeichnet. Wenn der Wert auf Button festgelegt ist, wird der RadioButton als Schaltfläche dargestellt, die vom gedrückten in den nicht gedrückten Zustand umgeschaltet werden kann. Beide Arten können Text, ein Bild oder beides anzeigen.

Beispiel

Im folgenden Codebeispiel wird ein RadioButton erstellt und initialisiert. Dieser soll als umschaltbares Steuerelement dargestellt werden, die AutoCheck-Eigenschaft wird auf false festgelegt, und das Steuerelement wird in einem Form hinzugefügt.

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

Plattformen

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

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

RadioButton-Klasse
RadioButton-Member
System.Windows.Forms-Namespace
Appearance-Enumeration