
How-To... - Make a Popup Menu
Creating
a popup menu in
your Visual Basic program is very simple, just one line of code(within a IF
statement). You usually put it in objects MouseDown procedure. First you need
to create your menu using the Menu Editor. In my example, I have made the
menu invisible at run-time. The code to make the menu popup is:-
If Button = vbRightButton
Then PopupMenu Me.mnuPopup
If you want to use the left button for the menu to popup, use vbLeftButton instead of vbRightButton.
You can download the source code by clicking here