RadioButton.PerformClick Méthode
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.
Génère un événement Click pour le contrôle, ce qui simule un clic de l'utilisateur.
public:
void PerformClick();
public void PerformClick ();
member this.PerformClick : unit -> unit
Public Sub PerformClick ()
Exemples
L’exemple de code suivant évalue une ListBox sélection et la Checked propriété d’un RadioButton. Lorsqu’un élément spécifié est sélectionné dans la zone de liste, la PerformClick méthode d’un autre RadioButton est appelée. Cet exemple nécessite que deux RadioButton contrôles et un ListBox aient été instanciés sur un formulaire.
private:
void ClickMyRadioButton()
{
// If Item1 is selected and radioButton2
// is checked, click radioButton1.
if ( listBox1->Text == "Item1" && radioButton2->Checked )
{
radioButton1->PerformClick();
}
}
private void ClickMyRadioButton()
{
// If Item1 is selected and radioButton2
// is checked, click radioButton1.
if (listBox1.Text == "Item1" && radioButton2.Checked)
{
radioButton1.PerformClick();
}
}
Private Sub ClickMyRadioButton()
' If Item1 is selected and radioButton2
' is checked, click radioButton1.
If (listBox1.Text = "Item1") And radioButton2.Checked Then
radioButton1.PerformClick()
End If
End Sub
S’applique à
Voir aussi
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour