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

jquery - Invalid Assignment Left-Hand Side -

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

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -