Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# reflection
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 31-Jul-12 4:34am
Edited 31-Jul-12 4:42am
Malli_S25.8K
v2
Comments
xavior885 at 1-Aug-12 3:00am
   
I was new to this and your solution helped me alot. thank you very much

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v2
Comments
Sergey Alexandrovich Kryukov at 31-Jul-12 12:26pm
   
Of course, a 5.
--SA
Zoltán Zörgő at 31-Jul-12 12:52pm
   
Thany you
Sergey Alexandrovich Kryukov at 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ő at 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 at 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)

  Print Answers RSS
0 OriginalGriff 275
1 DamithSL 265
2 CPallini 235
3 Maciej Los 185
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 31 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100