RadioButton.Appearance 属性

定义

获取或设置一个值,该值用于确定 RadioButton 的外观。

public:
 property System::Windows::Forms::Appearance Appearance { System::Windows::Forms::Appearance get(); void set(System::Windows::Forms::Appearance value); };
public System.Windows.Forms.Appearance Appearance { get; set; }
member this.Appearance : System.Windows.Forms.Appearance with get, set
Public Property Appearance As Appearance

属性值

Appearance

Appearance 值之一。 默认值是 Normal

例外

分配的值不是 Appearance 值之一。

示例

下面的代码示例创建和初始化 a RadioButton,为它提供切换控件的外观,将其 AutoCheck 属性设置为 false,并将其添加到 a Form

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 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

注解

Appearance如果值设置为Normal,则会RadioButton使用圆形复选框绘制控件。 如果值设置为 ButtonRadioButton 则将绘制为可切换为向上或向下状态的控件。 任一类型都可以显示文本、图像或两者。

适用于

另请参阅