I have Windows Forms application and I need to disable MouseRightclick on my Application except on some controls..is there any generalize method to do so...or i have to disable it on each controls? thanks.
Asked
Active
Viewed 865 times
2 Answers
4
A right-click doesn't do anything until you give it a meaning. Like setting a control's ContextMenuStrip property or writing an event handler for the MouseDown event. A few controls do have predefined behavior, TextBox for example has its own baked-in context menu. You don't want to disable it.
So disable it by simply not doing anything to make it work. IMessageFilter is indeed the only other hack.

Hans Passant
- 922,412
- 146
- 1,693
- 2,536