I can get the list of all forms:
Assembly asm = Assembly.LoadFrom(_assemblyPath); // Get the list of types defined in the assembly and derived from System.Windows.Forms.Form var lForms = asm.GetTypes().Where(x => x.IsSubclassOf(typeof(Form))).ToList();
But then I have a problem when I am trying to instantiate the types (as I need to retrieve the controls of the form).
I cannot use the:
Form o = Activator.CreateInstance(form, true) as Form;
as some forms have no default constructors defined.
Is there any other way to retrieve the data I need?
Regards
VulpesPosted May 12, 2011, 6:42 AM
If you do need to instantiate the controls, you'll need to call the InitializeComponent() method using reflection (as it's private) and hope that there's no other code in the constructor that affects the controls.