According to the .NET doc, calling the CreateControl() will create a
handle for the winform control and its child. But I doesn't seem to get
it work.

I have a code like this :

private void button6_Click(object sender, System.EventArgs e)
{
m_Form2 = new Form2();
m_Form2.CreateControl();
// This should show me TRUE. But instead, it show me FALSE which is
// the not expected.
MessageBox.Show(m_Form2.IsHandleCreated.ToString());

}

Is this a know issue or I miss out something ?

Re: Control.CreateControl does not create Handle by Sanjeeva

Sanjeeva
Tue Jun 01 01:33:59 CDT 2004

It works for all the controls not the form.
Check for the any controls it should work..


--
Regards,
Sanjeeva
Proteans Software Solutions

"Jonathan Yong" <dataerror@someplace.com> wrote in message
news:eabWg75REHA.3476@tk2msftngp13.phx.gbl...
> According to the .NET doc, calling the CreateControl() will create a
> handle for the winform control and its child. But I doesn't seem to get
> it work.
>
> I have a code like this :
>
> private void button6_Click(object sender, System.EventArgs e)
> {
> m_Form2 = new Form2();
> m_Form2.CreateControl();
> // This should show me TRUE. But instead, it show me FALSE which is
> // the not expected.
> MessageBox.Show(m_Form2.IsHandleCreated.ToString());
>
> }
>
> Is this a know issue or I miss out something ?
>