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.
Prochainement : Tout au long de l'année 2024, nous supprimerons progressivement les GitHub Issues en tant que mécanisme de retour d'information pour le contenu et nous les remplacerons par un nouveau système de retour d'information. Pour plus d’informations, voir:Soumettre et afficher des commentaires pour