click event on a nested control

H

Hai NIng

I have a form that has a bunch of nested controls in it. How do I detect a
mouse click on any of those controls in that form? I don't actually care
which control receives the click event in this case, just want to know if
any part of this form is being clicked on. Obviously I could hookup the
clicked event of every single child control, but is there an easier way?

Thanks.

- Harry
 
C

ClayB [Syncfusion]

You could have your form implement IMessageFilter. Take a look at this
thread in this forum from yesterday. It discusses how you can catch mouse
actions anywhere on a UserControl no matter what child control got the
message. You could do something similar with your form.

How to capture UserControl mouse events in it's container
Stefan Friday, June 18, 2004 12:17 PM


======================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools
 

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