To control all forms from the main form, keep track of all of the other forms. For example, you could build an array in the main form and store references to new forms there. Then you can loop through the array and close them all (or do whatever else you want to do with them). To close one form and show another, try something like: Form new_form = new Form2(); new_form.Show(); this.Close(); Note that this will close the program if the form you are closing is the startup form. Rod
- Marked As Answer byKira QianMSFT, ModeratorTuesday, October 06, 2009 2:14 AM
-
|