i want to load a usercontrol that is stored at the harddisk under lets say
ctrl.dll onto the form dynamically from within the code. I must be able to
create the ctrl.dll later not entering a reference into the project.
Is this possible someway?
thanks.
This is pretty easy using Reflection. Suppose you want an instance of the
usercontrol myNamespace.myControl on your form:
Dim assem As System.Reflection.Assembly =
System.Reflection.Assembly.LoadFrom("C:\...\ctrl.dll")
Dim ctrl As System.Windows.Forms.Control =
Activator.CreateInstance(assem.GetType("myNamespace.myControl"))
Me.Controls.Add(ctrl)
You would have to set the Top and Left properties and all the other needed
properties of your user control.
Hope this helps,
Jan
"Willie wjb" <wjb...@nomail.nl> wrote in message
news:#YMa#spKDH...@TK2MSFTNGP09.phx.gbl...
"Jan Tielens" <j...@nospam.leadit.be> wrote in message
news:%23qTz89p...@TK2MSFTNGP09.phx.gbl...