-
Make the menu on the main form as normal, but make the top-most item invisible.
Eg
mnuMyCustom "Custom Menu"
--mnuEditInNotepad "Edit In Notepad"
--mnu... "....."
--etc etc etc
Then, when you want the menu to popup - normally in a mousedown event;
PopUpMenu [formname].mnuMyCustom
Look up help for PopUpMenu for more information.
When the menu item is selected from the popupmenu any code attached to the Click event of the menu is run (as normal). However, this isn't ideal as you normally want to write the code in the function that pops the menu up - in that case this is what I do..
On the form where the menu is (normally the main form) - for this example it is frmMain.
Public MenuSelected as Integer
In each click event of the items on the customer menu;
MenuSelected= [unique number]
In the code where you want the menu to popup;
frmMain.MenuSelected=-1
PopUpMenu frmMain.mnuMyCustom
select case frmMain.MenuSelected
case -1
(no items were selected from the menu)
case 1
(do whatever you want the menu item where you set menuselected=1 to do)
case 2
....
etc
End Select
Hope this make sense..
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
-
Oooops, really sorry, I forgot to tell that this was a continue of a previous message, that hadn't anything to do with Visual Basic, just how to make my own menuitem in explorer. =)
Sorry.
-
Does anyone know how to made a Cascading menu ?
Which I can put some custom commands in ?
Like:
My Custom
|___Edit In Notepad
|___Some Stuff
|___Some other Stuff