Home All Groups Group Topic Archive Search About

How to use Form.GetChildAtPoint

Author
24 Nov 2004 3:22 PM
Jan_Weingärtner
Hi.

I have placed a panel at location (0,0) on a form.

With:

    Control ctrl = this.GetChildAtPoint(new Point(50, 50));

i try to find the panel, but ctrl is always null.
What is my problem?

best regards and thanks,
Jan

Author
24 Nov 2004 4:06 PM
Carlos J. Quintero [MVP]
I have tried this using VB.NET and it works fine, the Panel is retrieved. I
suppose that your panel is big enough, isn´t it?

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

  Dim ctrl As Control

  ctrl = Me.GetChildAtPoint(New Point(50, 50))

End Sub
--

Carlos J. Quintero

The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com


Show quote
"Jan Weingärtner" <jweing***@gmx.de> escribió en el mensaje
news:OsWflnj0EHA.1392@TK2MSFTNGP14.phx.gbl...
> Hi.
>
> I have placed a panel at location (0,0) on a form.
>
> With:
>
>    Control ctrl = this.GetChildAtPoint(new Point(50, 50));
>
> i try to find the panel, but ctrl is always null.
> What is my problem?
>
> best regards and thanks,
> Jan
Author
24 Nov 2004 5:12 PM
Jan_Weingärtner
Well, it works now. I don't know why ... sorry

best regards,
Jan
Author
24 Nov 2004 4:59 PM
Pieter Jansen van Vuuren
Does your panel have a height and width of at least 50?

Show quote
"Jan Weingärtner" <jweing***@gmx.de> wrote in message
news:OsWflnj0EHA.1392@TK2MSFTNGP14.phx.gbl...
> Hi.
>
> I have placed a panel at location (0,0) on a form.
>
> With:
>
>     Control ctrl = this.GetChildAtPoint(new Point(50, 50));
>
> i try to find the panel, but ctrl is always null.
> What is my problem?
>
> best regards and thanks,
> Jan

AddThis Social Bookmark Button