Rohit Kumar
How do I dynamically load a control from a DLL?
By Rohit Kumar in Windows Forms on Apr 09 2013
  • Sai Krishna
    Dec, 2018 14

    You use System Reflection to dynamically load a control. If the DLL is named "SpecControls.DLL" and the class you want is "SpecControls.ColorControl", then use this code.// load the assemblySystem.Reflection.Assembly assembly = Assembly.LoadFrom("SpecControls.DLL");// get the typeType t = assembly.GetType("SpecControls.ColorControl");Control c = (Control)Activator.CreateInstance(t);parent.Controls.Add(c);

    • 0
  • Sai Krishna
    Dec, 2018 14

    You use System Reflection to dynamically load a control. If the DLL is named "SpecControls.DLL" and the class you want is "SpecControls.ColorControl", then use this code.// load the assemblySystem.Reflection.Assembly assembly = Assembly.LoadFrom("SpecControls.DLL");// get the typeType t = assembly.GetType("SpecControls.ColorControl");// create an instance and add it.//Control c = (Control)Activator.CreateInstance(t);parent.Controls.Add(c);

    • 0
  • Munesh Sharma
    Apr, 2014 23

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/939afd00-18fd-4ea5-92f1-ec343876b801/dynamically-load-user-controls-from-a-dll-file-in-c-net?forum=csharpgeneral

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS