M
marfi95
I have a form that has a left and right panel. In the left panel is a
treeview. The right panel I want to change dynamically based on the
type of node selected. What I'm doing is loading the treeview nodes
through an XML file. As part of each node in the XML, I'm using an
attribute that indicates the name of a sub form to load. As part of
all these little child forms, the main control is a panel, which I
then assign its parent to the right panel of the main form. i.e.
frmSubForm.pnlSub.Parent = pnlBottomRight.
I have the tree loaded fine with no problems. I found some code using
reflection that would load the form as an object, but I haven't
figured out how to assign the panel fields parent because it doesn't
know the "type" of form.
Basically, I'm trying to load sub-forms into a panel on a main form
dynamically given the name of the form in a string.
Hope this makes sense. Is there an easier way to do what I'm trying.
Many thanks,
Mark
treeview. The right panel I want to change dynamically based on the
type of node selected. What I'm doing is loading the treeview nodes
through an XML file. As part of each node in the XML, I'm using an
attribute that indicates the name of a sub form to load. As part of
all these little child forms, the main control is a panel, which I
then assign its parent to the right panel of the main form. i.e.
frmSubForm.pnlSub.Parent = pnlBottomRight.
I have the tree loaded fine with no problems. I found some code using
reflection that would load the form as an object, but I haven't
figured out how to assign the panel fields parent because it doesn't
know the "type" of form.
Basically, I'm trying to load sub-forms into a panel on a main form
dynamically given the name of the form in a string.
Hope this makes sense. Is there an easier way to do what I'm trying.
Many thanks,
Mark