none
Creating a Wizard-Style Application RRS feed

  • Question

  • My current project is to develop a wizard-style application, with next, back, cancel, etc.

    I'm running into a problem with how I should implement the wizard. My first thought was to use panels for each step, but this quickly became overwhelming when I had 30 panels of the same size, all on top of each other. I had to use Send to Back repeatedly until I got to the step that I wanted to work on.


    My next thought was to use separate forms, but I don't like this approach very much either. I would have to copy over the elements that stay the same on each step (the navigation buttons) to each from and line them up. This takes too much work.

    Lastly, I thought of maybe making my own control, similar to a tab control, only the tabs would no be visible at runtime. This would take a lot of effort, so I'm hoping that someone can tell me an easier way.


    Before anyone suggests this, I absolutely refuse to code each step by hand. The best thing about Visual Studio is its designer and I plan to use.

    Wednesday, April 19, 2006 8:54 AM

Answers

  • The best way to handle this would be a single Host Form - to act as the main Wizard, and a collection of User Controls to act as each "Page".

    The Main Form would have the Next, Back, etc buttons as well as any extraneous text or images.  It's main feature would be a Panel located wherever you want the Pages to appear.

    As the user clicks Next or Back, your logic removes the current page from myWizardForm.Panel1.Controls and adds the next page (user control) to display.

    You will want to derive each page user control from a common base, to give the wizard a set of functionalities to call (like maybe SetData()/GetData() or what-not.).

    This will allow you to code each page on it's own, with a forms designer and all the bells and whistles.

    Wednesday, April 19, 2006 9:45 AM
  • For 10 or more pages i never use a Wizard control, but i create Pages. The pages are just classes that inhire the UserControl or Panel class. Then you will have al pages in seperated classes.

    On your form you just put the logic for switching Pages.

    Here are some articles about existing Wizard Controls:
    Wednesday, April 19, 2006 10:23 AM
    Moderator

All replies

  • I say you use separate forms, you "have to copy over the elements that stay the same on each step (the navigation buttons) to each form and line them up" because you "absolutely refuse to code each step by hand". You can design a form and then you can create many instances of it using codes. You design what is common among the forms, and you code what is needed (Button Names, Textboxes etc..).
    Wednesday, April 19, 2006 9:37 AM
  • The best way to handle this would be a single Host Form - to act as the main Wizard, and a collection of User Controls to act as each "Page".

    The Main Form would have the Next, Back, etc buttons as well as any extraneous text or images.  It's main feature would be a Panel located wherever you want the Pages to appear.

    As the user clicks Next or Back, your logic removes the current page from myWizardForm.Panel1.Controls and adds the next page (user control) to display.

    You will want to derive each page user control from a common base, to give the wizard a set of functionalities to call (like maybe SetData()/GetData() or what-not.).

    This will allow you to code each page on it's own, with a forms designer and all the bells and whistles.

    Wednesday, April 19, 2006 9:45 AM
  • For 10 or more pages i never use a Wizard control, but i create Pages. The pages are just classes that inhire the UserControl or Panel class. Then you will have al pages in seperated classes.

    On your form you just put the logic for switching Pages.

    Here are some articles about existing Wizard Controls:
    Wednesday, April 19, 2006 10:23 AM
    Moderator
  • I have the same problem. The way I used to do this in VB6 was to use the tab control, put the tabs at the bottom, remove borders and use a picture box to hide the tabs! I know, a little horrible, but it works a treat. And you still get the advantages of a tab control. I'm going to try this next week and if I can find this post again I'll tell you how it went.

    Cheers

    Jon 

    Friday, August 18, 2006 11:54 PM