Why the child windows cannot to show? But when I remark the line
"pf.MdiParent = this;", the frmProduct window showed but not a child window.
Is it the VS 2005 bug?
I write the code as:
Caller:
private void AppendProductToolStripMenuItem_Click(object sender,
EventArgs e)
{
frmProduct pf = frmProduct.GetChildInstance();
pf.MdiParent = this;
pf.Show();
pf.BringToFront();
}
frmProduct class:
private static frmProduct m_Productform;
public static frmProduct GetChildInstance()
{
if (m_Productform == null) //if not created yet, Create an
instance
m_Productform = new frmProduct();
return m_Productform; //just created or created earlier.Return
it
}