Active form

  • Thread starter Thread starter Mart
  • Start date Start date
M

Mart

How can I get a reference to the form that is active/visible. Is there a
form collection in an application?
Is there something like this possible:

foreach Form form in Application.formscollection
{
if form.visible == true
{
now I know what the active form is...
}
}

From within a certain class I need to know what the active form is...
Any suggestions?
I am developing for the compact framework!

Thanks in advance,

Mart
 
You have to do that manually if you really need that functionality. In the
activated event of each form assign a public static variable of your class
(and in the deactivated remove it). In other words, keep track of it
yourself.

Cheers
Daniel
 
Back
Top