CheckBox.Appearance CheckBox.Appearance CheckBox.Appearance CheckBox.Appearance Property

Définition

Obtient ou définit la valeur qui détermine la présentation d'un contrôle 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

Valeur de propriété

Une des valeurs de Appearance.One of the Appearance values. La valeur par défaut est Normal.The default value is Normal.

Exceptions

La valeur assignée ne fait pas partie des valeurs Appearance.The value assigned is not one of the Appearance values.

Exemples

L’exemple de code suivant crée et initialise un CheckBox, lui donne l’apparence d’un bouton bascule, affecte AutoCheck à la falsevaleur et l’ajoute à un 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

Remarques

Si Appearance la valeur est définie Normalsur, CheckBox le a une apparence typique.If Appearance value is set to Normal, the CheckBox has a typical appearance. Si la valeur est définie sur Button, le CheckBox s’affiche comme un bouton bascule, qui peut être basculé vers le haut ou vers le haut.If the value is set to Button, the CheckBox appears like a toggle button, which can be toggled to an up or down state.

S’applique à

Voir aussi