SplitContainer and GetChildAtPoint

G

Guest

I have a UserControl that I have a SplitContainer in.
I have placed several Controls in the panel1 and 2 of the split container
and I want to be able to do a "GetChildAtPoint" when clicking on the
UserControl.

However, all I get is the SplitContainer as result. How can I disregard the
splitcontainer or how could I find the control underneath the mouse when
clicking.

I already to PointToClient on the X and Y gotten from MouseDown and pass
that point to GetChildAtPoint and that's when it fails to get the child I
clicked on. It gets its parent i.e. the SplitContainer.

Greatful for any help at all.
 
G

Guest

You should call the GetChildAtPoint of the splitter container , and then on
the splitter container panel to get the exact control. you should also no
that you sould consider the location of each of the container controls you
use, and if they are not located in the top left position of the form, you
should deduct their location from the x and y got from the mouse event
 

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