Suraj Tadge
How do I close the child window without closing the whole application in windows forms..?
By Suraj Tadge in Windows Forms on Jun 06 2013
  • pankaj kumar
    Jul, 2015 3

    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

    • 0
  • Mohan Gopi
    Aug, 2013 20

    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

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS