ToolStrip.Items 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 tous les éléments qui appartiennent à un ToolStrip.
public:
virtual property System::Windows::Forms::ToolStripItemCollection ^ Items { System::Windows::Forms::ToolStripItemCollection ^ get(); };
public virtual System.Windows.Forms.ToolStripItemCollection Items { get; }
member this.Items : System.Windows.Forms.ToolStripItemCollection
Public Overridable ReadOnly Property Items As ToolStripItemCollection
Valeur de propriété
Objet de type ToolStripItemCollection, représentant tous les éléments contenus par un ToolStrip.
Exemples
L’exemple de code suivant ajoute une collection d’éléments à un ToolStrip.
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[]
{
this.newToolStripButton,
this.openToolStripButton,
this.saveToolStripButton,
this.printToolStripButton,
this.toolStripSeparator,
this.cutToolStripButton,
this.copyToolStripButton,
this.pasteToolStripButton,
this.toolStripSeparator1,
this.helpToolStripButton});
Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.newToolStripButton, Me.openToolStripButton, Me.saveToolStripButton, Me.printToolStripButton, Me.toolStripSeparator, Me.cutToolStripButton, Me.copyToolStripButton, Me.pasteToolStripButton, Me.toolStripSeparator1, Me.helpToolStripButton})
Remarques
Utilisez la Items collection pour récupérer tous les éléments qui ont été ajoutés au ToolStrip, pas seulement les éléments affichés. Un élément reste dans la Items collection même s’il s’agit d’un élément de dépassement de capacité et n’est donc pas visible actuellement.
Utilisez la DisplayedItems propriété pour récupérer uniquement les éléments actuellement affichés sur le ToolStrip.
S’applique à
Voir aussi
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