Z
Zach
I have a situation similar to what you see in Visual Studio Options
menu. A Tree View on the left, and depending on what type of node you
click it dynamically loads a panel into the right hand side of the
form.
It would be really nice if I could design all possible right hand side
panels in the forms designer, then have some way to tell the framework
"load the form represented by the class SuchAndSuchForm". What I have
to resort to currently is this:
1) Drop a panel into the right hand side of my main form.
2) Drop all the controls onto it and lay it out and everything
3) Manually edit the InitializeComponent() method and strip out all the
designer generated code into a separate method. Also remove the part
that calls Controls.Add()
This is very annoying, because I might have like 10 different types of
page I want to display on the right hand side. Not only is it a
headache stripping out code from the InitializeComponent() method that
many times, but if I want to make a change later to the layout of that
dynamic panel, it's not in the designer anymore.
I tried also making a totally new form and then change the base class
to derive from Panel instead of Form, but then it's not available in
the designer. If I could do that, then I could simply create a new
instance of that custom class type in the constructor. I also tried
leaving it as base class Form, but Form doesn't have a Dock attribute
which I would like to set to Fill since I use a splitter in the middle.
You'd think this would be a fairly common paradigm, Visual Studio
itself uses it.
Any suggestions?
Thanks
menu. A Tree View on the left, and depending on what type of node you
click it dynamically loads a panel into the right hand side of the
form.
It would be really nice if I could design all possible right hand side
panels in the forms designer, then have some way to tell the framework
"load the form represented by the class SuchAndSuchForm". What I have
to resort to currently is this:
1) Drop a panel into the right hand side of my main form.
2) Drop all the controls onto it and lay it out and everything
3) Manually edit the InitializeComponent() method and strip out all the
designer generated code into a separate method. Also remove the part
that calls Controls.Add()
This is very annoying, because I might have like 10 different types of
page I want to display on the right hand side. Not only is it a
headache stripping out code from the InitializeComponent() method that
many times, but if I want to make a change later to the layout of that
dynamic panel, it's not in the designer anymore.
I tried also making a totally new form and then change the base class
to derive from Panel instead of Form, but then it's not available in
the designer. If I could do that, then I could simply create a new
instance of that custom class type in the constructor. I also tried
leaving it as base class Form, but Form doesn't have a Dock attribute
which I would like to set to Fill since I use a splitter in the middle.
You'd think this would be a fairly common paradigm, Visual Studio
itself uses it.
Any suggestions?
Thanks