Home All Groups Group Topic Archive Search About

Knowing window handle from an control itself

Author
30 May 2006 10:00 AM
qingxun
Hi!

I am writing a custom control. Is there a way for my control to refer
to the form (that hosted this control) handle programmatically?

What I wanted to do is to set form property when the control properties
changes. How could I refer to form during design time when the form is
unknown?

Is there something like :

ContainerForm.Height = 50 ?



Thanks

Bob

Author
30 May 2006 12:46 PM
Herfried K. Wagner [MVP]
<qing***@gmail.com> schrieb:
> I am writing a custom control. Is there a way for my control to refer
> to the form (that hosted this control) handle programmatically?

Check out the control's 'FindForm' method.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
31 May 2006 2:12 AM
qingxun
Herfried K. Wagner [MVP] wrote:
> <qing***@gmail.com> schrieb:
> > I am writing a custom control. Is there a way for my control to refer
> > to the form (that hosted this control) handle programmatically?
>
> Check out the control's 'FindForm' method.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>


Thanks. Never thought that the solution is that simple. 8-)