Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI Guyz,

i have a form reference in dll and i want to invoke the form through its dll using reflection. My Question is, Is this possible? and if yes how ?
Posted
Updated 31-Jul-12 3:42am
v2
Comments
xavior885 1-Aug-12 3:00am    
I was new to this and your solution helped me alot. thank you very much

1 solution

Of course you can. Start here: http://martfish.wordpress.com/2011/08/23/using-reflection-to-open-a-form-by-name/[^].

But be aware that you need to add an extra interface (formal or not) to have communication between instantiating class and instantiated form - the argument passed to the constructor in the sample is one aspect of this.

You can use Assambly.GetTypes[^] to list all types and find the form descendants.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 31-Jul-12 12:26pm    
Of course, a 5.
--SA
Zoltán Zörgő 31-Jul-12 12:52pm    
Thany you
Sergey Alexandrovich Kryukov 31-Jul-12 12:55pm    
You recently provided a really good answer on plug-in unloading, please see my comment.
--SA
Zoltán Zörgő 31-Jul-12 12:58pm    
Yes that would be a good and really robust approach also in this case. But might be not needed if only loading them is required, and the dynamism of plugins is not.
Sergey Alexandrovich Kryukov 31-Jul-12 13:42pm    
Of course.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900