共用方式為


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

範例

下列程式碼範例會建立並初始化 RadioButton ,提供它切換控制項的外觀、將其 屬性設定為 false ,並將它 AutoCheck 新增至 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 使用圓形核取方塊繪製控制項。 如果值設定 Button 為 ,則會 RadioButton 繪製 為可切換為向上或向下狀態的控制項。 任一類型都可以顯示文字、影像或兩者。

適用於

另請參閱