RadioButton.AutoCheck Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit une valeur indiquant si la Checked valeur et l’apparence du contrôle changent automatiquement lorsque le contrôle est cliqué.
public:
property bool AutoCheck { bool get(); void set(bool value); };
public bool AutoCheck { get; set; }
member this.AutoCheck : bool with get, set
Public Property AutoCheck As Boolean
Valeur de propriété
true si la Checked valeur et l’apparence du contrôle changent automatiquement sur l’événement Click ; sinon, false. La valeur par défaut est true.
Exemples
L’exemple de code suivant crée et initialise un RadioButton, lui donne l’apparence d’un contrôle bascule, définit sa AutoCheck propriété falsesur , et l’ajoute à un 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
Remarques
Si la Checked valeur est définie falsesur , la RadioButton partie du contrôle doit être vérifiée dans le code dans le Click gestionnaire d’événements. En outre, si elle RadioButton fait partie d’un RadioButton groupe de contrôles, cette propriété garantit qu’un seul des contrôles est vérifié à un moment donné.
Si la AutoCheck propriété est définie falsesur , un groupe de RadioButton contrôles n’agit pas comme un groupe mutuellement exclusif et la propriété doit être mise à jour dans le Checked code.