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.

RE: SplitContainer and GetChildAtPoint by guybar

guybar
Tue Apr 11 04:29:02 CDT 2006

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
--
GuyBar


"Adergaard" wrote:

> 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.