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
Post a Comment