Control.CreateControl does not create Handle

  • Thread starter Thread starter Jonathan Yong
  • Start date Start date
J

Jonathan Yong

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 ?
 
It works for all the controls not the form.
Check for the any controls it should work..
 
Back
Top