Hi,
I have a winform namely form1 that contains 2 radio buttons namely goto_form2 and goto_form3. If i select goto_form2 then it shold close the form1 and open new form(form2). And in form2 I have button called `back` which should on clicking take control back to the form1 and goto_form3 should also behave in the same way as goto_form2.
StevePosted Apr 11, 2009, 12:29 AM
Niradhip ChakrabortyPosted Apr 10, 2009, 1:41 PM
Can you please tell us where exactly you are facing problems. If you are facing problem to close the form, Please check the following code.
To close all Mdi child forms from code within the Mdi parent itself, you can use:
foreach (Form f in this.MdiChildren)
{
f.Close();
}
To close them from some other form, replace 'this' with a reference to the Mdi Parent form.
To open another form, just create an instance of it and call the Show() or ShowDialog() methods on that instance, depending on whether its modal or not.
You also can refer the following Article:
http://www.csharp411.com/close-all-forms-in-a-thread-safe-manner/