I have a menu consisting of 3 sections, each with 3 submenus. The name of one of these submenus is "exit" (it is in "help" menu, you can see in my picture).
My problem is: I open several windows, and when I apply to "exit", he must close all the already opened windows.
How can I do that? It is windows application in c#.
Asked
Active
Viewed 42 times
0
-
Please define "all windows" and specify which UI framework (WinForms, WPF) do you use. – Dmitry Dec 09 '21 at 18:21
-
My menu bar is compiled of 3 sections (Menu, Windows, Help). Menu is complied of "Task","Tips","Exit" submenus. Windows is complied of "Vertical", "Sequence", "Close" submenus. And Help is complied of "Help tool", "About" submenus. I use C# Net (WinForms). – Artur Dec 09 '21 at 19:47
-
My questions is not about your menus, but about a set of already opened windows you are going to close. What those windows are? Do they belong to the same application instance? – Dmitry Dec 09 '21 at 20:28
-
I think it is duplicate of this "https://stackoverflow.com/questions/2414244/how-do-i-properly-close-a-winforms-application-in-c" – Yair I Dec 09 '21 at 20:28
-
So just calling the Close() method on your main window doesn't work? – Duston Dec 09 '21 at 20:31