Here is the sample code.

        private void ShowControlsFromAssembly(string assemblyfile)
        {
            Assembly assembly = Assembly.LoadFrom(assemblyfile);
            Type[] et = assembly.GetExportedTypes();
            foreach (Type t in et)
            {
                Form frm = (Form)assembly.CreateInstance(  t.FullName);
                foreach (Control ctrl in frm.Controls)
                {
                    listBox1.Items.Add(ctrl.Name);
                }
 
            }
        }
VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Programatically get list of Installed Programs
  2. Load user controls dynamically with ASP.NET
  3. Visual SourceSafe Programming
  4. Populate listbox in a thread in .net
  5. Get Environment Variables