| Author: Abhisek Panda 03 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
You can just add the name of the forms in the list box and when the user selects a form and click on OK use if clause to invoke the particular form. In the if create constructor of the form and invoke ShowDialog method to call the form.
Thanks And Regards, Abhisek Panda Be Happy And Make Others Happy. Go Green and Save Your Future.
|
| Author: Anuraj 03 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
Try this
Assembly asm = Assembly.GetExecutingAssembly(); Type[] types = asm.GetTypes(); foreach(Type t in types) { if (t.IsSubclassOf(typeof(System.Windows.Forms.Form))) { this.DropDownList1.Items.Add(t.Name); } }
Thanks Anuraj THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS. BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT. dotnetthoghts
|