DOCUMENT NO. : CAG 08H
SARADHA COURSE GUIDE – PROGRAMMING WITH
REV. NO.: R0 DATE: 23/07/2020
GANGADHARAN VISUAL BASIC
COPY :
COLLEGE
DOCUMENT TITLE PAGE 46 OF 70
UNIT IV
MENUS, DIALOG BOXES & MDI Edition : 1
MenuStrip: The Menu Editor
Menus can be attached only to forms, and they’re implemented through the MenuStrip control.
The items that make up the menu are ToolStripMenuItem objects. The MenuStrip control and
ToolStripMenuItem objects give you absolute control over the structure and appearance of the
menus of your application. The MenuStrip control is a variation of the Strip control, which is
the base of menus, toolbars, and status bars. You can design menus visually and then
program their Click event handlers.
After drag the Menustrip on your form you can directly create the menu items by type a value
into the "Type Here" box on the menubar part of your form
/tmp/unoconv_1710462176.doc
PREPARED/REVISED BY : F. Jeno Sandana Brina Rouvier REVIEWED & APPROVED BY : D. Saraswathi
DESIGNATION : ASSIST. PROF. – B.C.A DESIGNATION : Asst. prof, M.Sc(cs)
DATE : 06/07/2020 DATE : 06/07/2020
, MANUAL TITLE
DOCUMENT NO. : CAG 08H
SARADHA COURSE GUIDE – PROGRAMMING WITH
REV. NO.: R0 DATE: 23/07/2020
GANGADHARAN VISUAL BASIC
COPY :
COLLEGE
DOCUMENT TITLE PAGE 47 OF 70
UNIT IV
MENUS, DIALOG BOXES & MDI Edition : 1
If you need a separator bar, right click on your menu then go to insert->Separator.
After creating the Menu on the form , you have to double click on each menu item and write
the programs there depends on your requirements. The following Vb.Net program shows how
to show a messagebox when clicking a menu item.
EX: Public Class Form1
Private Sub MenuItem1ToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MenuItem1ToolStripMenuItem.Click
MsgBox("You are selected MenuItem_1")
End Sub
End Class
ToolStrip control
ToolStrip control provides functionality of a Windows toolbar controls in Visual Basic. ToolStrip
class represents a ToolStrip control in Windows Forms and serves as a base class of
MenuStrip, StatusStrip, and ContextMenuStrip classes. ToolStrip control has its properties and
methods.
/tmp/unoconv_1710462176.doc
PREPARED/REVISED BY : F. Jeno Sandana Brina Rouvier REVIEWED & APPROVED BY : D. Saraswathi
DESIGNATION : ASSIST. PROF. – B.C.A DESIGNATION : Asst. prof, M.Sc(cs)
DATE : 06/07/2020 DATE : 06/07/2020