Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right Click Menu

Status
Not open for further replies.

cwalshe

Programmer
May 28, 2001
84
0
0
IE
Hi there,

I am wondering if its possible to add a menu item to the existing menu for when you select and right click something in any application.

Basically, if you select text or a graphic and right click, can you add a new menu item.

Thx,

Cormac.
 
Sounds like you are taking about a popup menu.

To create a popup menu, create it as any other menu using the menu editor. Make sure it starts as a top level menu and set its visible property to false (uncheck it).

In your code on the mouseup event of the form and/or control place the following code.

'// Show the popup menu.
If Button = vbRightButton Then Form1.PopupMenu mnuPopup

mnuPopup is the name given to the topmost level of the menu that you want as the popup menu. You also don't have to create a separate menu, you can use an exiting one like the the 'File' menu.
Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top