CheckBox.Appearance プロパティ

定義

CheckBox コントロールの外観を決定する値を取得または設定します。Gets or sets the value that determines the appearance of a CheckBox control.

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 値のいずれか。One of the Appearance values. 既定値は Normal です。The default value is Normal.

例外

代入された値が、Appearance 値ではありません。The value assigned is not one of the Appearance values.

次のコード例では、をCheckBox作成して初期化し、トグルボタンの外観、 AutoCheckfalseに設定して、にForm追加します。The following code example creates and initializes a CheckBox, gives it the appearance of a toggle button, sets AutoCheck to false, and adds it to a Form.

public:
   void InstantiateMyCheckBox()
   {
      // Create and initialize a CheckBox.   
      CheckBox^ checkBox1 = gcnew CheckBox;
      
      // Make the check box control appear as a toggle button.
      checkBox1->Appearance = Appearance::Button;
      
      // Turn off the update of the display on the click of the control.
      checkBox1->AutoCheck = false;
      
      // Add the check box control to the form.
      this->Controls->Add( checkBox1 );
   }
public void InstantiateMyCheckBox()
 {
    // Create and initialize a CheckBox.   
    CheckBox checkBox1 = new CheckBox(); 
    
    // Make the check box control appear as a toggle button.
    checkBox1.Appearance = Appearance.Button;
 
    // Turn off the update of the display on the click of the control.
    checkBox1.AutoCheck = false;
 
    // Add the check box control to the form.
    Controls.Add(checkBox1);
 }
 
Public Sub InstantiateMyCheckBox()
    ' Create and initialize a CheckBox.   
    Dim checkBox1 As New CheckBox()
    
    ' Make the check box control appear as a toggle button.
    checkBox1.Appearance = Appearance.Button
    
    ' Turn off the update of the display on the click of the control.
    checkBox1.AutoCheck = False
    
    ' Add the check box control to the form.
    Controls.Add(checkBox1)
End Sub

注釈

Value AppearanceがにNormal設定されてCheckBoxいる場合、は標準的な外観になります。If Appearance value is set to Normal, the CheckBox has a typical appearance. 値がにButton設定されているCheckBox場合、はトグルボタンのように表示され、上下の状態に切り替えることができます。If the value is set to Button, the CheckBox appears like a toggle button, which can be toggled to an up or down state.

適用対象

こちらもご覧ください