Knowing window handle from an control itself

Q

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
 
H

Herfried K. Wagner [MVP]

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.
 

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