Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:36:51+00:00 2026-06-12T09:36:51+00:00

Our application contains many modules which could be dynamically pushed to the our application

  • 0

Our application contains many modules which could be dynamically pushed to the our application after it is installed and running. All those modules might require some display at the UI. So I am thinking that we could build a UI exe which could load UI component from a DLL (or any other type of assembly). Let’s say module1 and module2 are active at the machine, we would display a “module1” and “module2” at the left frame of the UI. If user clicks on “module1”, the right frame would open the screen for module1 which is loaded from the another assembly (such as DLLs) which is pushed down together with module1.

Just wonder if this pluggable UI architecture is even possible at the Windows Form or not. I did some search on internet and I didn’t find any useful information around this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:36:52+00:00Added an answer on June 12, 2026 at 9:36 am

    Yes it is possible and I have done this my self.

    The best way to do this is you create a 2nd DLL outside of the program. Inside that DLL you define a interface that your plugin will implement. You then make your form in the main EXE load all the DLL’s in a directory and see if it contains any classes that implement that interface. In your plugin DLL’s you also reference the same DLL and have your modules implement that interface. Any functions you want common to all of your Plugins you need to put in to IMyPlugin as that is the interface you will be casting everything to in your UI so only those functions will be visible.

    //In a 2nd project that compiles as a DLL
    public interface IMyPlugin
    {
        Control GetControl();
    }
    
    ///////////////////
    
    //In your main project
    private List<IMyPlugin> pluginsList;   
    
    private void MainForm_Load(object sender, EventArgs e)
    { 
        foreach(string pluginPath in Directory.EnumerateFiles(Application.StartupPath + @"\Plugins\", "*.dll"))
        {
            try
            {
                //load the assembly
                Assembly pluginAssembly = Assembly.LoadFrom(pluginPath);
    
                //Find all types defined in the assembly.
                Type[] types = pluginAssembly.GetTypes();
    
                //Filter the types to only ones that implment IMyPlugin
                var plugins = types.Where(x => typeof(IMyPlugin).IsAssignableFrom(x));
    
                //Filter the plugins to only ones that are createable by Activator.CreateInstance
                var constructablePlugins = plugins.Where(x => !x.ContainsGenericParameters && x.GetConstructor(Type.EmptyTypes) != null);
    
                foreach (var pluginType in constructablePlugins)
                {
                    //instantiate the object
                    IMyPlugin plugin = (IMyPlugin)Activator.CreateInstance(pluginType);
    
                    pluginsList.Add(plugin);
                }
            }
            catch (BadImageFormatException ex)
            {
                //ignore this exception -- probably a runtime DLL required by one of the plugins..
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "MainForm.MainForm_Load()");
            }
        }
    
        //Suspend the layout for the update
        this.SuspendLayout();
        this.someFlowLayoutPanelToStoreMyPlugins.SuspendLayout();
    
        foreach(IMyPlugin plugin in pluginsList)
        {
            this.someFlowLayoutPanelToStoreMyPlugins.Controls.Add(plugin.GetControl());
        }
        //resume the layout
        this.someFlowLayoutPanelToStoreMyPlugins.ResumeLayout(false);
        this.someFlowLayoutPanelToStoreMyPlugins.PerformLayout();
        this.ResumeLayout();
    }
    
    
    //////////////////////
    
    
    // In your plugin DLL.
    
    public class Plugin : UserControl, IMyPlugin
    {
        public Plugin()
        {
            //The code in the main form requires there be a public 
            //  no parameter constructor (either explicitly or implicitly),
            //  UserControls usually have one anyway for InitializeComponent.
    
            InitializeComponent();
        }
    
        public Control GetControl()
        {
            return this;
        }
    
        // The rest of your code.
    }
    

    Note: This code was just copying and pasting a lot of my code, I don’t know if it will work perfectly as is, but this will get you close to where you need to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For our Kunagi Java web application we have a signed kunagi.jar file which contains
Our application consists of three parts: 1. A core module, which contains model and
While defining our application architecture (which contains both web UI and external web services)
Recently, sometimes (rarely) when we export data from our application, the export log contains
Our web server is structured as follows /path-to-docdir [Contains main pages] ./app/ [Some application
In our application, we are having various windows which contain grid and their respective
Our solution file contains many different projects including an ASP.NET MVC web app, a
In our application, we have some forms which need to show some data specifically
We are using Oracle Weblogic 10.3 as our application server. We have multiple modules
We are using apache commons logging in our application for all our logging requirements.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.