Difficulty: 2/5
This is just copy and paste, and it's only basics. it's up to you how to use it.
Firstly, we must have a menu on our screen, so right click the form and go into the menu editor and create your menu. This Menu will be the menu that appears as the pop-up menu, so add in the code and etc for all the different menu buttons there are.
Good, no, set the main menu thing, IE the menu title, such as File, Edit, etc, as Invisible or uncheck the visible box. Now this menu will not be seen as a normal menu, so it's like you'r form doesn't even have one.
Now, go into the code where you want to call this menu, whether it be a right click, or a double click, or a key press, whatever, and add:
Code:
Me.popupmenu mnuName
mnuName should be the name of the Heading menu you created that we set to Invisible. PopupMenu basically ignores visibility settings, and will only popup the sub-menus you added to the menu, so the Header won't be visible, but you should still set it to a nice name you can remember.
And tada! A nifty popup menu for whatever you wish to use it for.
Expansions:
There are otehr things you can do with popUpMenu. The full call can go as such:
Code:
Me.PopupMenu Menu as Object, [Flags], [X], [Y], [Defaultmenu]
X and Y are obviously the positions you want to use, and DefaultMenu will be in BOLD. You can only have one bold menu object.
the Flags are as follows:
vbpopupmenuLeftAlign
vbpopupmenuCenterAlign
vbpopupmenuRightAlign
These are self explanatory
And here are the behavior flags:
vbpopupmenuLeftButton - Default. This means everything will react when you use the left mouse button.
vbpopupmenuRightButton - Samea s above, only uses Right mouse Button. (Not Default)
So jsut in case you wanted to use them, here they are! Hope this helps some people.