How do I'll to close all the windows?
-
well I've this trouble, I need to close all the windows in my app.... I'm using MDIForms. To close some forms I use this code above: foreach(Form frm in this.MdiChildren)//when this is my MDIParent { frm.Close(); } seems simple but I need to close ShowDialog Forms (ShowDialog isn't a MDIChild), when one ShowDialogForm is open I can't to close it, It's still open, How do I'll to close it? Thanks
-
well I've this trouble, I need to close all the windows in my app.... I'm using MDIForms. To close some forms I use this code above: foreach(Form frm in this.MdiChildren)//when this is my MDIParent { frm.Close(); } seems simple but I need to close ShowDialog Forms (ShowDialog isn't a MDIChild), when one ShowDialogForm is open I can't to close it, It's still open, How do I'll to close it? Thanks
Alex I am still a newbie at C# also but I am developing a MDIApplication and I am using a Login form as a dialog. To close that form I have put a close button on the form and then used the code this.dispose(); as the way to close it. private void button1_Click(object sender, EventArgs e) { this.dispose(); } Hope this helps! Allan Allan F. Gagnon
-
Alex I am still a newbie at C# also but I am developing a MDIApplication and I am using a Login form as a dialog. To close that form I have put a close button on the form and then used the code this.dispose(); as the way to close it. private void button1_Click(object sender, EventArgs e) { this.dispose(); } Hope this helps! Allan Allan F. Gagnon
You should use the
Close
method instead ofDispose
to close your login form.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Alex I am still a newbie at C# also but I am developing a MDIApplication and I am using a Login form as a dialog. To close that form I have put a close button on the form and then used the code this.dispose(); as the way to close it. private void button1_Click(object sender, EventArgs e) { this.dispose(); } Hope this helps! Allan Allan F. Gagnon
Thanks Allan But I can to close one window.... The problem is many windows.. I'm going to explain my app, when time expire I need to close all windows that are open, however, some of these windows are ShowDialog, when I execute the sample code above the only windows that are closed are the MDIChildren, however, ShowDialog windows not is MDIChild and therefore still open, I can't handle these. I don't know who is owner of theses windows ShowDialog() I'm tired..:laugh: