Panel Container

S

stotty

Hello.

I am developing an application that uses Panels to guide the user
through a form they must fill out. Each Panel contains different
controls, such as Text Boxes and Drop Down Lists. When the user clicks
the Next button, it sets all Panel.Visible to False and sets only the
current Panel that should be displayed to Visible = true.

My problem is that a lot of the time the panels just never appear. What
I think is going on, is that when i drag them all to the same area of
the form, some panels are engulfing (becoming the parent) of some other
panels, causing them to never display. I want all my Panels to be
placed on the same part of my form but for them each to be separate
entities.

Has anyone had any experience with this or can lend me a hand?

Cheers,

Chaz Stotland
 
T

Truong Hong Thi

You could enlarge the form and tile the panels to make it easier to
design.
On form loading, resize the form to the desired size.
Also need to reset the location of each panel to be equal to the 1st
panel.
 
D

Dave Sexton

Hi,

A better approach in general might be to create a single containing Form (a
wizard shell) and multiple UserControls, one for each panel (wizard dialog).
You can create a wizard controller class that will guide the user through the
wizard by responding to events such as the Next button being clicked and then
swapping the appropriate UserControls that should be visible in the main Form.
This way you can design each "panel" in a separate designer.

This approach lends it self nicely to user process components, which can be
useful for handling the navigation logic of the wizard when you have a lot of
complex steps and UserControls, a pluggable architecture or when you'd like to
target multiple platforms such as WinForms, web or mobile, that all require
the same processing logic.

Also if you want, each UserControl can implement an interface that you define
to retrieve state information and data when they're loaded by the wizard
controller.
 
S

stotty

Thanks. I appreciate both of your inputs. In lieu of not completely
starting over the wizard half of my project i decided to stick with the
panels. They way I solved the problem of them not overlapping each
other was at runtime to manually set there location all to the same
stop on my form. this ensures none of them swallows the other when you
attempt to drag them all on top of each other at design time...

thanks again.

chaz
 

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