Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
You can add just one menu item or several items at a time to a ContextMenuStrip.
To add a single menu item to a ContextMenuStrip
Use the Add method to add one menu item to a ContextMenuStrip.
[Visual Basic]
Me.contextMenuStrip1.Items.Add(Me.toolStripMenuItem1)this.contextMenuStrip1.Items.Add(toolStripMenuItem1);
To add several menu items to a ContextMenuStrip
Use the AddRange method to add several menu items to a ContextMenuStrip.
[Visual Basic]
Me.contextMenuStrip1.Items.AddRange(New _ System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItem1, _ Me.toolStripMenuItem2})this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripMenuItem1, this.toolStripMenuItem2});