4
Reply

How to open Child window in parent window,C# windows Application

Santosh More

Santosh More

12y
21.1k
0
Reply

      foreach (Form childForm in MdiChildren)
                {
                    childForm.Close();
                }
                Form2 obj= new Form2();
                obj.MdiParent = this;
                obj.Show();

    Use this code in VB.NET

      Child frm = new Child();
       frm.MdiParent = this;
       frm.Show();

    if you opening the child form on button click event FROM parent window....

    then..... use following Code Snippet......


       // Create a new form to represent the child form
    frmChild frm = new frmChild();

    // Make the new form a child form. frm.MdiParent = this;
    // Display the child form. frm.Show();


    from parent

    child.show(this);