Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Dynamically constructing a form in a generic container

Dynamically constructing a form in a generic container

Scheduled Pinned Locked Moved C#
csharpquestionc++databasecom
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OBRon
    wrote on last edited by
    #1

    I'm not sure if what I'm wanting to do is possible in C# or not, but I thought I'd pose the question. In C++, we are able to create ActiveX controls and host them in a generic container. The container can read a menu system from a database and populate a tree and have an assigned GUID for the object to construct when each tree node is clicked. Can this phisophy be done in a Windows form .NET application (without ActiveX)? Can I construct a Form or a UserControl by simply reading in the form class name from a database table? I know I can create a builder class that could return a new object for a given piece of text, but that would mean I would have to update this builder class each time a new form were developed. I would like to create a container that never had to be modified...not sure if that is possible. Ron Ward

    N 1 Reply Last reply
    0
    • O OBRon

      I'm not sure if what I'm wanting to do is possible in C# or not, but I thought I'd pose the question. In C++, we are able to create ActiveX controls and host them in a generic container. The container can read a menu system from a database and populate a tree and have an assigned GUID for the object to construct when each tree node is clicked. Can this phisophy be done in a Windows form .NET application (without ActiveX)? Can I construct a Form or a UserControl by simply reading in the form class name from a database table? I know I can create a builder class that could return a new object for a given piece of text, but that would mean I would have to update this builder class each time a new form were developed. I would like to create a container that never had to be modified...not sure if that is possible. Ron Ward

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Absolutely, I would suggest you read through an article by Jason Clark on MSDN titled: Let Users Add Functionality to Your .NET Applications with Macros and Plug-Ins[^]. - Nick Parker
      My Blog | My Articles

      O 1 Reply Last reply
      0
      • N Nick Parker

        Absolutely, I would suggest you read through an article by Jason Clark on MSDN titled: Let Users Add Functionality to Your .NET Applications with Macros and Plug-Ins[^]. - Nick Parker
        My Blog | My Articles

        O Offline
        O Offline
        OBRon
        wrote on last edited by
        #3

        Thank you Nick! This is exactly what I needed. I had heard the Reflection term thrown around, but never realized what it was. Being a Visual C++ developer, this term means something very different to me. Thank you again. :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups