MenuStrip (msp)

The menus and toolbars in .NET 2.0 are known as "strip" controls
A menu is located on the menu bar and contains a list of related commands.
The MainMenu control lets you add menus to your programs. You an also add special effects such as access keys, check marks and keyboard shortcuts.


ToolStrip - use this for toolbars you can attach to the top of the window
MenuStrip - use this for menus
ContextMenuStrip -
StatusStrip -
ToolStripContainer -



Each control has an Items collection


You can add/change the icon using the Image property.


Context Menu

separator

Menu.Add("-") 


The MainMenu control lets you assign shortcut keys to your menus


Main Menu Properties and Methods
Shortcut - The shortcut key to assign
ShowShortcut - Whether to display the shortcut on the menu
Checked - ??



Menu convention

Every menu title and menu command should have an initial capital letter

  • Use short, specifc caption consisting of one or two words

  • Assign each menu item an access key. Use the first letter of the item if possible

  • Place an ellipsis ( ... ) after a menu command that displays a dialog box


To add an access key, insert an ampersand character (&).
Double click the menu items to create event procedures for them.


Menu Separator

You can manually insert a separator by typing a dash and pressing Enter.





PopUp Events






© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext