Designing a Wizard

M

Mike Bresnahan

I am creating a setup/installation wizard using C# and Windows.Forms. The
application consists of a single form which displays multiple wizard
"pages". The pages are displayed one at a time when the user clicks on the
Back and Next buttons. Only one page is visible at any one time. How
should I design this application with the Visual Studio .NET designer?

My first idea was to create a multiple classes that derive from Panel, one
for each different wizard page and one for the 3 buttons that appear on
every wizard page. However, I cannot design a panel in the Visual Studio
..NET designer. I can only design a Form, Control, or UserControl.

My second idea was to create multiple classes that derive from UserControl,
one for each different wizard page and one for the 3 buttons that appear on
every wizard page. However, I don't understand how to drag and drop my
custom user controls onto my other GUI objects. It appears I have to put my
controls in a separate library project and then reference the resulting
assembly. Having two projects instead of one seems overly complex.

Is there a better solution?

Mike Bresnahan
 
H

Herfried K. Wagner [MVP]

* "Mike Bresnahan said:
I am creating a setup/installation wizard using C# and Windows.Forms. The
application consists of a single form which displays multiple wizard
"pages". The pages are displayed one at a time when the user clicks on the
Back and Next buttons. Only one page is visible at any one time. How
should I design this application with the Visual Studio .NET designer?

Maybe you will find some "ideas" here:

I remember the magic library includes a wizard framework:

<http://sourceforge.net/projects/dotnetmagic/>

Other samples (in C# too):

<http://www.codeproject.com/cs/miscctrl/tswizard.asp>
<http://www.codeproject.com/cs/miscctrl/ak_wizard.asp?print=true>
 
S

Stu Smith

Just out of curiosity, is there a reason you need to use Panel as your base,
as opposed to UserControl?
 
M

Mike Bresnahan

Stu Smith said:
Just out of curiosity, is there a reason you need to use Panel as your base,
as opposed to UserControl?

As it turns out, no not really. I converted the whole app to use
UserControls instead of Panels and now it is much more IDE-friendly. The
only reason I started with Panels is that, coming from JBuilder, it was
what I had done before. With JBuilder you can derive from any GUI class and
have your control get painted in the IDE. You are not restricted to Form,
UserControl, and Control. There may be good reasons for this, but it had me
confused at first.

In retrospect, I could have alternatively simply placed my Panel derivatives
inside UserControls, i.e. aggregation instead of inheritance. The gist
seems to be that UserControl is simply an adapter (a la the Adapter Pattern)
that allows custom controls be manipulated by the IDE.

Mike Bresnahan
 

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