Search In Site

25 June, 2013

How To Use Visual Basic Predefined Menus

Using The Visual Basic Predefined Menus
You can use the Visual Component Manager to add a predefined menu to a form (note that not all versions of Visual Basic come with the Visual Component Manager). As you can see in the Visual Component Managers Visual Basic|Templates|Menus folder , six predefined menus are available. These menus include a File menu, an Edit menu, a Help menu, a Window menu, and so on. To add one of these menus to a form, just select the form and double-click the menu in the Visual component Manager.

Adding a predefined menu also adds code to the form. For example, here’s the skeletal code that’s added when you add a predefined File menu:

Private Sub mnuFileNew_Click()
MsgBox "New File Code goes here!"
End Sub

Private Sub mnuFileOpen_Click()
MsgBox "Open Code goes here!"
End Sub

Private Sub mnuFilePrint_Click()
MsgBox "Print Code goes here!"
End Sub

Private Sub mnuFilePrintPreview_Click()
MsgBox "Print Preview Code goes here!"
End Sub

Private Sub mnuFilePrintSetup_Click()
MsgBox "Print Setup Code goes here!"
End Sub

Private Sub mnuFileProperties_Click()
MsgBox "Properties Code goes here!"
End Sub

Private Sub mnuFileSave_Click()
MsgBox "Save File Code goes here!"
End Sub

Private Sub mnuFileSaveAll_Click()
MsgBox "Save All Code goes here!"
End Sub

Private Sub mnuFileSaveAs_Click()
MsgBox "Save As Code goes here!"
End Sub

Private Sub mnuFileSend_Click()
MsgBox "Send Code goes here!"
End Sub

0 comments:

Post a Comment

Dear Visitors All The Tricks And Hacks Posted Here Are Only For Knowledge Purpose.Don't Use These for Illegal Operations.

 
Twitter Bird Gadget