mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* Merge winforms framework content to working branch (#14) * Breadcrumb / TOC / Move net5 to net folder (#15) * change path from net5 to net * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Mess with bread/toc * Add .net 5 winforms placeholder article (#16) * added some metadata and adjusted net5 placeholder * corrections * corrections * corrections * Test1 * Swapping landing page vs concept * fix links * Fix links * Fix desc
1.5 KiB
1.5 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|---|
| How to: Add Menu Items to a ContextMenuStrip | 03/30/2017 |
|
|
1ec14776-3ea2-4752-bd22-4fae0fd19e1a |
How to: Add Menu Items to a ContextMenuStrip
You can add just one menu item or several items at a time to a xref:System.Windows.Forms.ContextMenuStrip.
To add a single menu item to a ContextMenuStrip
-
Use the xref:System.Windows.Forms.ToolStripItemCollection.Add%2A method to add one menu item to a xref:System.Windows.Forms.ContextMenuStrip.
Me.contextMenuStrip1.Items.Add(Me.toolStripMenuItem1)this.contextMenuStrip1.Items.Add(toolStripMenuItem1);
To add several menu items to a ContextMenuStrip
-
Use the xref:System.Windows.Forms.ToolStripItemCollection.AddRange%2A method to add several menu items to a xref:System.Windows.Forms.ContextMenuStrip.
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});