Hide / Disable Visio control right-click menu

E

EliA

Hi,

I'm working with a Visio control on a C# form and I'm trying to
disable the context menu that pops up on a right click (or just hide
it from the users).

Does anybody have any idea?

Thanks,
Eli.
 
A

AlEdlund

all you should have to do is add your own right mouse click event and
capture the trigger.
al
 
E

EliA

all you should have to do is add your own right mouse click event and
capture the trigger.
al

Hi al,

Thanks,
I used the right-click events (both MouseDown and MouseUp) to perform
some action, but the visio context menu still pops up..
Do you have any idea why isn't it working for me?

Thanks again,
Eli.
 
A

AlEdlund

did you do an addadvise so that the event will be captured?
al

all you should have to do is add your own right mouse click event and
capture the trigger.
al

Hi al,

Thanks,
I used the right-click events (both MouseDown and MouseUp) to perform
some action, but the visio context menu still pops up..
Do you have any idea why isn't it working for me?

Thanks again,
Eli.
 
Y

Yangyong

Sample code:

void VisApp_MouseUp(int Button, int KeyButtonState, double x, double y,
ref bool CancelDefault) {
CancelDefault = true;
}
 
E

EliA

Thanks all!

It worked great.

I also have another problem I need help with:

I'm trying to disable the Ctrl+C and Ctrl+V shortcut keys (or to
generally intercept all shortcut keys pressed),
but capturing the KeyDown, KeyUp and KeyPressed events just don't seem
to do it..

do you have any idea why?

Thanks again,

Eli.
 

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