dynamic controls in split container

G

Guest

I have a windows application that has a split container in the client area.
In the left panel, I added controls via the designer in VS 2005. In the right
panel, I want to dynamically create and display other forms that I created in
the project. Is this possible? Can the panel2 of a split container be the
container for a dynamically created form? How else can I create a series of
other windows (forms) and place them in the right panel of the split
container at run time? I am sure there is a way, just not familiar enough
with VS 2005 or C# to know. Thanks.
 
F

Frisky

I have a windows application that has a split container in the client area.
In the left panel, I added controls via the designer in VS 2005. In the
right
panel, I want to dynamically create and display other forms that I created
in
the project. Is this possible?

Yes. Just create the form, panels, and other controls dynamically. You will
have to create each item and almost all of their attributes. Look at the
code that Visual Studio generates when you drop a control on a form. You
will have to mimic something like this.
Can the panel2 of a split container be the container for a dynamically
created form?

Wow. I am not quite sure what the question is here. You can create a panel
dynamically and link to it from code elsewhere. But, you have to handle
keeping track of the appropriate controls and linkage.
How else can I create a series of other windows (forms) and place them in
the right panel of the split container at run time?

Well, I can think of lots of ways to do this. The basic issue is creating
the controls, forms, panels, etc. dynamically, making sure you assign all of
the properties, and setup all of the linkages. Not necessarily hard to do,
but lots of details and usually quite a bit of code. The key will be having
good clean interfaces that are well organized, so that you can get to what
you need to when you need to.

You can use the Visaul Studio designer generated code as a basic guide on
what you need to do. It is really doing the same thing for a form. It just
writes the code for you.

Hope this helps...

Frisky
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top