2
Reply

How do I close the child window without closing the whole application in windows forms..?

Suraj Tadge

Suraj Tadge

Jun 06, 2013
2.2k
0

    private void button1_Click(object sender, EventArgs e){Form2 frm2 = new Form2();frm2.FormClosed += new FormClosedEventHandler(frm2_FormClosed);frm2.Show();this.Hide();}private void frm2_FormClosed(object sender, FormClosedEventArgs e){this.Close();}try This this might be helpful

    pankaj kumar
    July 03, 2015
    0

    Hi Suraj, try this List openForms = new List(); foreach (Form f in Application.OpenForms) openForms.Add(f); foreach (Form f in openForms) { if (f.Name != "Menu") f.Close(); } i hope this will help you. let me known

    Mohan Gopi
    August 20, 2013
    0