If you have a reference to the System.Windows. Forms assembly you can use:
object o = Activator.Creat eInstance(typeo f(System.Window s.Forms.Control ));
If you don;t you need to use:
Type t = Type.GetType("S ystem.Windows.F orms.Control, System.Windows. Forms, Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9");
object o = Activator.Creat eInstance(t);
Incidently its a bit unusual to want to create aninstance of the base Control class, what are you trying to do
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
Hi All
I need to create a windows form control(from System.Windows. Forms.dll
assembly) dynamically using Activator.How do I achieve this?Sample code is
much more helpful.
Thanks in advance
Regards
Krishna