Trap mouseclick of a certain area in the form

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hello All,

Is it possible to detect a mouseclick of a certain area of the form ?.
I try to achieve to prevent mouseclick(s) of a certain area inside the form
while the rest of the area is allowed to recieve mouse click(s) --
Touchscreen

Can somebody tell me how to achieve this ?

Thanks a lot
Peter
 
In the MouseDown(Up) event you get the mouse coordinates which can use to
find out if it's inside of a certain rectangle by using Rectangle.Contains
method.
 
Thanks Alex,

Will try it..... Can you tell me how to preventing when a mouseclick occurs
in a certain area of the form to prevent from doing anything
For example :
Having a main form with on the foreground an other application , I want to
prevent when on a mouseclick on the visible part of the main form, the main
form would be the topmost form and to prevent to set the other application
in the background...

Thanks

Peter.
 
Back
Top