ToolStripDropDownItem.ShowDropDown 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.
Affiche le contrôle ToolStripDropDownItem associé à ce ToolStripDropDownItem.
public:
void ShowDropDown();
public void ShowDropDown ();
member this.ShowDropDown : unit -> unit
Public Sub ShowDropDown ()
Exceptions
ToolStripDropDownItem est le même que le ToolStrip parent.
Exemples
L’exemple de code suivant montre comment afficher un ToolStripDropDownItem contrôle lorsqu’un bouton est enfoncé. Cet exemple de code fait partie d’un exemple plus grand fourni pour la ToolStripDropDownItem classe .
// This method shows the drop-down for the first item
// in the form's ToolStrip.
private void showButton_Click(object sender, EventArgs e)
{
ToolStripDropDownItem item = this.toolStrip1.Items[0] as ToolStripDropDownItem;
if (item.HasDropDownItems)
{
item.ShowDropDown();
}
}
' This method shows the drop-down for the first item
' in the form's ToolStrip.
Private Sub showButton_Click( _
ByVal sender As Object, _
ByVal e As EventArgs) _
Handles showButton.Click
Dim item As ToolStripDropDownItem = CType(Me.toolStrip1.Items(0), ToolStripDropDownItem)
If item.HasDropDownItems Then
item.ShowDropDown()
End If
End Sub
Remarques
Utilisez la ShowDropDown méthode pour afficher les contrôles de liste déroulante qui ont été définis par la DropDown propriété .
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de l’année 2024, nous abandonnerons progressivement le mécanisme de retour d’information GitHub Issues pour le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultez :Soumettre et afficher des commentaires pour