How to get the number of visible forms on screen ?
-
How could I get the number of (local - belonging to the same application) forms on the screen ? There is a class Screen at System.Windows.Forms.Screen but it doesn't hold any variable of visible forms on the screen (of the current application). If the class has nothing to do with forms then why is it under the FORMS.Screen namespace at all, rather that just Windows.Screen ? Regards, Desmond
-
How could I get the number of (local - belonging to the same application) forms on the screen ? There is a class Screen at System.Windows.Forms.Screen but it doesn't hold any variable of visible forms on the screen (of the current application). If the class has nothing to do with forms then why is it under the FORMS.Screen namespace at all, rather that just Windows.Screen ? Regards, Desmond
if i am not mistaken, there is nothing in "System.Windows" except the forms namespace... this is probably because the current .net windows gui system is called "Windows Forms" as to counting the number of open forms, why not either make an inheritable form with a counter to use in your applications, or increment and decrement a counter when you open/close forms.... other then that all i can think of is using EnumWindows in user32, and checking the window titles...
-
if i am not mistaken, there is nothing in "System.Windows" except the forms namespace... this is probably because the current .net windows gui system is called "Windows Forms" as to counting the number of open forms, why not either make an inheritable form with a counter to use in your applications, or increment and decrement a counter when you open/close forms.... other then that all i can think of is using EnumWindows in user32, and checking the window titles...
I think it's easier just to derive a class from System.Windows.Forms.Form, overload it's constructor and add there itself to a arraylist MyForms, or something like that. That way I also don't have to identify the forms (if they belong to me not another application on screen).
-
I think it's easier just to derive a class from System.Windows.Forms.Form, overload it's constructor and add there itself to a arraylist MyForms, or something like that. That way I also don't have to identify the forms (if they belong to me not another application on screen).
sure it wasn't sure that was your goal :)