"Take Over" Right-Click for Certain Controls?

L

LarryP

If possible I'd like to "hijack" the right-click event for certain controls
on a form, so I can use MouseDown(right) to run VBA code rather than
presenting the shortcut menu. Anybody know if it can be done? (NOTE: I
don't want to disable Shortcut menu for the entire form, only for certain
controls.)
 
C

Clif McIrvin

LarryP said:
If possible I'd like to "hijack" the right-click event for certain
controls
on a form, so I can use MouseDown(right) to run VBA code rather than
presenting the shortcut menu. Anybody know if it can be done? (NOTE:
I
don't want to disable Shortcut menu for the entire form, only for
certain
controls.)


Did you investigate the MouseDown, MouseUp events for you control(s)?
 
L

LarryP

Yes, actually I have a solution to my immediate problem that uses the
MouseDown(Right, Alt) event, but in working that out I got to wondering if
there's a way to use MouseDown(Right) for something else and suppress the
default of displaying the shortcut menu. I know one can turn off the latter
completely across an entire application, but I'd find it useful if the same
thing can be done on a control-by-control basis.
 
C

Clif McIrvin

LarryP said:
Yes, actually I have a solution to my immediate problem that uses the
MouseDown(Right, Alt) event, but in working that out I got to
wondering if
there's a way to use MouseDown(Right) for something else and suppress
the
default of displaying the shortcut menu. I know one can turn off the
latter
completely across an entire application, but I'd find it useful if the
same
thing can be done on a control-by-control basis.

Good. As I said, I've not sailed these waters before, I posted only
because I didn't notice any other takers, and wondered if you'd
investigated this avenue. As to actually answering your question, I'm
afraid that I simply do not know, and don't have time to investigate
just now.

While you're waiting to see if someone else chimes in, have you searched
the archives (I use Google Groups) for references to context menu, or
mouse event, or right click? There are so many groups out there I
usually cast a wide net (search all groups) at least at the beginning of
a research venture.

Good Luck!

(When you find your answer, please post back here so others can
benefit!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top