c# - Retrieve a hidden form -


i have hidden form want show. don't want create 1 this:

form1 f1 = new form1(); 

since i'm using notification area icon. when opening new window, multiple notification area icons.

so there way show hidden form?

yes.

linq way:

var frm = application.openforms.oftype<form>().firstordefault(x => x.gettype() == typeof(form1));  if (frm != null) {    frm.show(); } 

or iterate on application.openforms

foreach (var form in application.openforms) {     if (form form1)     {          form.show();          break;     } } 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -