Hello! You can load an assembly by calling System.Reflection.LoadFrom. When you have the assembly you should be able to get the Type of the class (usercontrol) by calling your_assembly_reference.GetType("_namespace_._usercontrol_"). When you have the type you can create an instance of the class by calling System.Activator.CreateInstance().How to load a specific userControl Dllat runtime
Normally a userControl is added at design time and draw the the userControl to a specific location in the form.
We have two different userControl and one of these should be loaded depending on a value in the database. So at runtime should the value in the database decide which one of the usercontrol to load.
And also specify where on the form this userControl should be placed.
I assume this is possible but I just wonder which class and method to use to accomplish this.
//TonySv: How to load a specific userControl Dllat runtime
In case GetType won't return any types you might have to have the reference of the module inside the assembly. The easiest way to get the reference to the module should be: assembly_reference.GetModules()[0]. The module reference then have a GetType-method too, use that one instead.
Msdn might be good reading, and/or Reflector (it's a program, use google to find it, it's like the first match), in case you get stuck.