Close All Child Window on Menu Click!
-
I am working on a MDIForm in C#. Here we can open many child form inside MDI, now I am trying to write a code which can close all child form on menu click. Please let me know right code. Thanks
Sr...Frank wrote:
Please let me know right code.
By this you mean, write code for me. No. You have a list of the child windows, iterate through them and close. If you have tried and need help, then post what you have tried and ask.
I know the language. I've read a book. - _Madmatt
-
I am working on a MDIForm in C#. Here we can open many child form inside MDI, now I am trying to write a code which can close all child form on menu click. Please let me know right code. Thanks
-
private void button2_Click(object sender, EventArgs e)
{
foreach (Form2 f in this.MdiChildren)
{
f.Dispose();
}
} -
please don't remove messages, it is against the forum guidelines. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
If you want my opinion or comment, ask in a forum or on my profile page; I will not participate in frackin' Q&A
-
private void button2_Click(object sender, EventArgs e)
{
foreach (Form2 f in this.MdiChildren)
{
f.Dispose();
}
}Please don't feed the idiots.
I know the language. I've read a book. - _Madmatt