10-The Menu Strip


This Visual Basic tutorial is all about The Menu Strip.
The MenuStrip control serves as the container for the menu structure. It works as the top-level container for the menu structure. It is composed of ToolStripMenuItem class and the ToolStripDropDownMenu class that provide the functionalities such as create menu items, sub menus and drop-down menus.


Example for adding MenuStrip.

In the toolbox select menustrip control and drag it into the form.


Click the MenuStrip control and add the following menus such as File, View, and help.


Click the File menu and add the following submenus such as New and Close.



See the example below for adding function in the MenuStrip control.


Click the File menu and double-click the Close submenu to fire the event handler of ToolStripMenuItem.


Add the following code in the CloseToolStripMenuItem click event handler .


The code in the view code will look like this.

Readers might read also:



Looking for more source code? Type your keyword here here!


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.