Dynamically constructing a form in a generic container
-
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
-
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
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 -
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