Is there any other way to access open forms in C#? -
application.openforms["formname"];
is there other way access open form. application doesn't see form although opened. dont know why.
isn't necessary name open form. can form want index:
form frm = application.openforms[0] //will main form form frm = application.openforms[1] //will first child
forms in openforms collection ordered in same way create it
otherwise, alternative save reference form , accessing reference.
//where want save reference: form theform; //where create form: myclass.theform = new myform(); //where want form: messagebox.show(myclass.theform.caption);
(myclass class hold reference form, supposing accessing different classes)
(also, see if affected this: application.openforms.count = 0 always)
Comments
Post a Comment