المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Find out if a class is initialized with reflection.



C# Programming
05-07-2009, 01:50 AM
Hello Forum.

I am building an application where menu to call the forms are table driven,

I can call the forms by using reflection as follows, however I need to verify first if this form is not open yet, and if it is just set the focus on this form.

My question is, how can I find out if the form is already open?

Thank you very much for your help

Assembly myAssembly = Assembly.GetExecutingAssembly();
Form myForm = myAssembly.CreateInstance(this.GetType().Namespace+".Form2") as Form;
myForm.Show();