How can I load a WindowsFormsControlLibrary UserControl from disk and then add it to the list of controls in a Windows Form at runtime programmatically?
I want to begin with nothing but a file name.
The fake code below illustrates. To be clear, I don't want to add it to the Visual Studio toolbox and use it at design-time. Instead, I want to load it at runtime, and insert it into a Windows Form without knowing anything about it but the file name.
if (File.Exists("SomeUserControl.dll"))
{
// Load SomeUserControl.dll from disk
// Do something to make it a control
// ...
UserControl SomeUserControl = new UserControl();
Controls.Add(SomeUserControl);
}