Professional Documents
Culture Documents
Introduction
So far, we have discussed several Features expected of Applications:
ToolBars with ToolBar Buttons
Using multiple Forms and Dialog Boxes
In Lectures 5 - 6, we will discuss the expected Menu capability:
Adding Menus to our VB .NET projects
Adding Submenus to our Project’s Menus
Creating Context Menus
Along the way, we will discuss the MenuStrip Control, which:
Allows you to add Menus, Menu Items, and SubMenu Items…
Contains a built in Menu Editor which allows you to:
Add, Change, and Delete Menu Items.
The Menus you create will also support related features:
Access Keys and Shortcut Keys
Check Marks
Access Keys and Shortcut Keys
Once created, your menus can support keyboard operation:
In addition to normal mouse-based opening, closing, and activation.
Access Keys:
Allow users to open a menu using the <Alt> key + a letter.
Example: <Alt x> (2 keys pressed simultaneously)
Once activated, the opened Menu will appear on the screen;
Opened Menus can be navigated easily, as usual:
Using the Arrow keys or the Mouse.
Shortcut Keys:
Which allow users to directly invoke a menu item
Often using a Function Key (e.g., F3), or the <Ctrl> key + a letter.
Example: <Ctrl x> (2 keys pressed simultaneously).
Once invoked by the user, Menu-driven effects take place normally.
Check Marks
Shown below is an example Project with a MenuStrip Control:
A CheckMark:
Provides True/False selection of the Item
Selection is not exclusive (independent of other Checkmarked items)
A Separator:
provides logical separation for groups of items.
The MenuStrip Control
To demonstrate, let’s make a simple Menu-based Editing project…
Adding Menu Items and SubMenus
Adding Toolbars (1):
Toolbars (2): Setting tspMain
Toolbars (3): Setting tspFormatting
Adding TextBoxes
Now, finish the GUI by adding two TextBoxes: