Exam 70-553 - Create and configure menus

Section 3

  • Part 1
    • Topic 3

Create and configure menus.

  • Create and configure a MenuStrip component on a Windows Form.
  • Change the displayed menu structure programmatically.
  • Create and configure the ContextMenuStrip component on a Windows Form.

Summary

The MenuStrip component is new to .Net 2.0 and replaces the MainMenu control.

The MenuStrip exposes an Items Collection which can be used to add ToolStripMenuItem Controls. These represent top level menu items (File, Edit, Tools, Help etc). Each ToolStripMenuItem Exposes a DropdownItems Collection which can be used to add more ToolStripMenuItem.Each ToolStripMenuItem can have an Access Key, an Image, and

The ContextMenuStrip Control is also new to .Net 2.0 and replaces the ContextMenu control. It can be used to display a short cut menu when a control is right clicked. Define the menu options much in the same way as the Main Menu control works and assign the ContextMenuStrip property of the control you want to associate it with to the name of your control.

Other Resources & Links:

MenuStrip Control (Windows Forms)
http://msdn2.microsoft.com/en-us/library/ms171649.aspx

ContextMenuStrip Control
http://msdn2.microsoft.com/en-us/library/ms229641.aspx

Master Toolbars and Menus with the New ToolStrip Control
http://www.devx.com/dotnet/Article/22001/0/page/1

Exam 70-553 - Implement data-bound controls.

Exam 70-553 - Add and configure a Windows Forms control.