次の方法で共有


RadioButton.Appearance プロパティ

オプション ボタン コントロールの外観を決定する値を取得または設定します。

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

プロパティ値

Appearance 値の 1 つ。既定値は Normal です。

例外

例外の種類 条件
InvalidEnumArgumentException 代入された値が、 Appearance 値ではありません。

解説

Appearance の値が Normal に設定されている場合、 RadioButton コントロールは、円形のチェック ボックス付きボタンとして描画されます。値が Appearance.Button に設定されている場合、 RadioButton コントロールは、選択解除されている状態と選択されている状態を示すトグル ボタンとして描画されます。どちらの状態でも、テキスト、イメージ、またはその両方を表示できます。

使用例

[Visual Basic, C#, C++] RadioButton を作成および初期化し、トグル ボタンのような外観にする例を次に示します。そのトグル ボタンの AutoCheck プロパティを false に設定し、トグル ボタンを Form に追加します。

 
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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

RadioButton クラス | RadioButton メンバ | System.Windows.Forms 名前空間 | Appearance