| title | ms.custom | ms.date | ms.prod | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | dev_langs | helpviewer_keywords | ms.assetid | caps.latest.revision | author | ms.author | manager | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
How to: Provide Standard Menu Items to a Form |
03/30/2017 |
.net-framework |
|
article |
|
|
75db9126-e70c-4e81-921d-b83c0a4a9f50 |
7 |
dotnet-bot |
dotnetcontent |
wpickett |
How to: Provide Standard Menu Items to a Form
You can provide a standard menu for your forms with the xref:System.Windows.Forms.MenuStrip control.
There is extensive support for this feature in [!INCLUDEvsprvs].
Also see Walkthrough: Providing Standard Menu Items to a Form.
Example
The following code example demonstrates how to use a xref:System.Windows.Forms.MenuStrip control to create a form with a standard menu. Menu item selections are displayed in a xref:System.Windows.Forms.StatusStrip control.
[!code-csharpSystem.Windows.Forms.ToolStrip.StandardMenu#1] [!code-vbSystem.Windows.Forms.ToolStrip.StandardMenu#1]
Compiling the Code
This example requires:
- References to the System, System.Drawing and System.Windows.Forms assemblies.
For information about building this example from the command line for [!INCLUDEvbprvb] or [!INCLUDEcsprcs], see Building from the Command Line or Command-line Building With csc.exe. You can also build this example in [!INCLUDEvsprvs] by pasting the code into a new project. Also see How to: Compile and Run a Complete Windows Forms Code Example Using Visual Studio.
See Also
xref:System.Windows.Forms.MenuStrip
xref:System.Windows.Forms.ToolStrip
xref:System.Windows.Forms.StatusStrip
MenuStrip Control