winforms - How to check if the Form object is till running with C# -


let's say, have 2 winforms here, form1 , form2 respectively. , made form1 hidden. wonder how write code in form2 detect if form1 object still running or not.

i trying use form1.activeform seems give me null value. better ideas? thanks.

you use method active forms:

public static form isformalreadyopen(type formtype) {    foreach (form openform in application.openforms)    {       if (openform.gettype() == formtype)          return openform;    }     return null; } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -