0% found this document useful (0 votes)
30 views

Creating Menu

This document provides steps for creating a dropdown menu in a Visual Basic project. The steps include opening the menu editor, adding menu items and commands, assigning shortcuts, and writing event procedures for the menu commands. Menu items are added by specifying a caption, name, shortcut, and other properties. Nested submenus can be created using the left arrow button. Finally, code is written to handle events for the menu commands, such as copying text to the clipboard.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Creating Menu

This document provides steps for creating a dropdown menu in a Visual Basic project. The steps include opening the menu editor, adding menu items and commands, assigning shortcuts, and writing event procedures for the menu commands. Menu items are added by specifying a caption, name, shortcut, and other properties. Nested submenus can be created using the left arrow button. Finally, code is written to handle events for the menu commands, such as copying text to the clipboard.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Creating dropdown menu in visual basic project-

Steps

1. Open menu editor by single click on menu editor in the tools menu. Or it may be also run by
the pressing CTRL +E
2. After opening menu editor it shows with the following options as –
Caption
Name
Shortcut
Enable
Visible
Next button
Insert button
Delete button
Left and Right arrow button
Up and down arrow button
3. Place menu name into the caption box like edit.
4. Place the variable name into name box like mnuedit
5. Place again command name into the caption box like copy
6. Assign shortcut key from shortcut dropdown combo box – CRTL + C
7. Place the variable name into name box like cmdcopy.
8. Repeat this process for the same next commands into this menu.
9. Use left arrow for creating one level inside the menu and use it at twice time then will create
the second level inside the menu.
10. After designing this menu go into the code window and write the event procedure related to
the menu command.
11. Code here
Private Sub CMDCOPY_Click()
If Text1.SelText = "" Then
MsgBox "please select the text before going to copy"
Exit Sub
Else
Clipboard.SetText Text1.SelText
MsgBox "YOUR TEXT HAS BEEN COPIED, YOU MAY PASTE THIS ANY TIME"
End If
End Sub

Private Sub CMDCUT_Click()


If Text1.SelText = "" Then
MsgBox "please select text before cut your text"
Exit Sub
Else
Clipboard.SetText Text1.SelText
Text1.SelText = ""
MsgBox "your selected text has been moved from this location, set destination"
End If
End Sub
Private Sub CMDPAST_Click()
Text1.SelText = Clipboard.GetText
End Sub
12. Test this by running project f5 function key

You might also like