| View previous topic :: View next topic |
| Author |
Message |
Dheeraj
Joined: 27 Aug 2007 Posts: 109
|
Posted: Fri Sep 12, 2008 5:39 am Post subject: How to Close All Opened Windows Forms in Windows App |
|
|
Hi ,
In my windows applications i want to close all opened windows forms by in a single click Event.
Please let me know asap... |
|
| Back to top |
|
 |
manoj
Joined: 21 Aug 2007 Posts: 102
|
Posted: Fri Sep 12, 2008 5:45 am Post subject: |
|
|
Hi,
You did not mention whether you are using MDI form or not. if so you are using MDI form as a preent to all your windows form. you can close all child forms like as follows..observer the code...
private void closeAllToolStripMenuItem_Click_1(object sender, EventArgs e)
{
int j = this.MdiChildren.Length;
for (int i = j; i > 0; i--)
// loop for all the mdi children
{
MdiChildren[i - 1].Close();
}
}
try this code.. i hope this will helps you..
all the best. |
|
| Back to top |
|
 |
|