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 843 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
- 897,808
- 140
- 1,634
- 2,455
0
There is a way - Capturing Mouse Events from every component on C# WInForm
-
@MAyank... thanks for your quick resposnse..i hope this will help me. – MaddY Mar 02 '11 at 05:46