Click here to Skip to main content
15,887,214 members
Articles / Programming Languages / C#
Article

A Simple Wizard Control for .Net 2.0 with Full Designer Support

Rate me:
Please Sign up or sign in to vote.
4.65/5 (131 votes)
4 Feb 2008CPOL4 min read 532.9K   13.9K   382   178
This is a simple yet powerful wizard framework for .Net 2.0. Just drag and drop and your component is ready for use.
WizardDemo1.png

Introduction

This control allows the creation of a wizard framework in seconds. All you need to do is drag and drop and your wizard is ready for use. This wizard control has full designer support and is highly customizable according to the needs of the user.

Background

I was trying to find a control similar to the wizard in ASP.NET. I learned that it is not available in the .NET Framework, so I decided to make a framework that would allow me to make a wizard in a few simple steps. The wizard control is easy to use - a beginner user should be able to use this control without any problems. The wizard control provides full designer support to users by allowing them to view current program actions.

Using the Library

Step 1: Add a reference to Wizarddemo.dll. This step will add the control automatically to the toolbox of Visual Studio.

Step 2: Drag and drop WizardControl to the form where you want to implement the wizard.

WizardDemo3.png

Once dragged, a wizard is created for the form.

Step 3: Use the designer to customize the designer.

WizardDemo4.png
WizardDemo6.png
WizardDemo7.png
WizardDemo8.png
WizardDemo9.png
WizardDemo10.png
WizardDemo2.png
WizardDemo5.png

Points of Interest

WizardControl

Properties

  • BackButtonEnabled - Defines whether or not the Back button is enabled or disabled.
  • BackButtonText - This can be used to get or set the text of the Back button.
  • BackButtonVisible - Indicates whether the Back button is visible or not.
  • NextButtonEnabled - Defines if the Next button is enabled or disabled.
  • NextButtonText - This can be used to get or set text of the Next button.
  • NextButtonVisible - Indicates whether the Next button is visible or not.
  • CancelButtonEnabled - Defines whether the Cancel button is enabled or disabled.
  • CancelButtonText - This can be used to get or set the text of the Cancel button.
  • CancelButtonVisible - Indicates whether the Cancel button is visible or not.
  • HelpButtonEnabled - Defines whether the the Help button is enabled or disabled.
  • HelpButtonText - This can be used to get or set the text of the Help button.
  • HelpButtonVisible - Indicates whether the Help button is visible or not.
  • FinishButtonText - Text of Finish button.
  • EulaButtonEnabled - Defines if the Eula label is enabled or disabled.
  • EulaButtonText - This can be used to get or set the text of Eula label.
  • EulaButtonVisible - Indicates whether the Eula label is visible or not.

Events

  • BackButtonClick - The Back button is clicked.
  • CancelButtonClick - The Cancel button is clicked.
  • FinishButtonClick - The Finish button is clicked.
  • HelpButtonClick - The Help button is clicked.
  • NextButtonClick - The Next button is clicked.
  • EulaButtonClick - The Eula button is clicked.
  • CurrentStepIndexChanged - Occurs after a current step index is changed.

StartStep

Properties

  • Title - Title text of the step.
  • TitleAppearence - Title appearance of the step.
  • SubTitle - The subtitle text of the step.
  • SubtitleAppearence - The subtitle appearance of step.
  • LeftPair - The back color appearance of the left panel.
  • BindingImage - Image for the step.
  • Icon - Icon displayed in the start step.
  • LeftPanelBackColor - If image is null, left panel back color.

Events

  • BindingImageChanged - Fires when BindingImageChanged of the step is changed.

LicenseStep

Properties

  • Title - Title text of the step.
  • TitleAppearence - Title appearance of the step.
  • SubTitle - Subtitle text of the step.
  • SubtitleAppearence - Subtitle appearance of step.
  • Warning - Warning text.
  • WarningFont - The warning text appearance of the step.
  • BindingImage - Image for the step.
  • HeaderPair - Appearance of header.
  • Accepted - Status of license agreement.
  • AcceptText - Accept text.
  • DeclineText - Accept text.
  • LicenseFile - License file to display.

Events

  • BindingImageChanged - Fires when BindingImageChanged of the step is changed.
  • AgreementChanged - Fires when license agreement of the step is changed.

IntermediateStep

Properties

  • Title - Title text of the step.
  • TitleAppearence - The title text appearance of the step.
  • SubTitle - Subtitle text of the step.
  • SubtitleAppearence - The subtitle appearance of the step.
  • HeaderPair - Appearance of the header.
  • BindingImage - Image for the step.

Events

  • BindingImageChanged - Fires when BindingImageChanged of the step is changed.

FinishStep

Properties

  • BindingImage - Background of the finish step.
  • Pair - Appearance of the body.

Events

  • BindingImageChanged - Fires when BindingImageChanged of the step is changed.

Known Issues

  • During the removal of the wizard control, the step code is not removed from the designer.

History

This is the first release of the wizard. Suggestions are welcome for improving this framework.

First revision: 02/2008

  • Generic designer integrated.
  • Advanced generic collections used.
  • Advanced generic type converters.
  • Very small in size.
  • Serialization support.
  • Reset support.
  • Shadow text support.
  • During the removal of the wizard control, the step code is not removed from the designer: fixed.
  • Problem with binding image fixed; it was not setting to null.
  • New events added.
  • License agreement step added.
  • Finish page updated.
  • Other small issues fixed.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Documentation? Pin
Wes Aday8-Feb-08 10:10
professionalWes Aday8-Feb-08 10:10 
GeneralRe: Documentation? Pin
dysert8-Feb-08 10:49
dysert8-Feb-08 10:49 
GeneralRe: Documentation? Pin
Wes Aday8-Feb-08 14:31
professionalWes Aday8-Feb-08 14:31 
GeneralRe: Documentation? Pin
dysert8-Feb-08 15:22
dysert8-Feb-08 15:22 
GeneralRe: Documentation? Pin
Wes Aday8-Feb-08 17:30
professionalWes Aday8-Feb-08 17:30 
QuestionRe: Documentation? Pin
dysert8-Feb-08 19:10
dysert8-Feb-08 19:10 
GeneralRe: Documentation? Pin
Wes Aday9-Feb-08 7:02
professionalWes Aday9-Feb-08 7:02 
QuestionRe: Documentation? [modified] Pin
dysert9-Feb-08 11:44
dysert9-Feb-08 11:44 
Thanks, Wes, but despite your help I think I'm in over my head. I did wire the "+=" to fire when the user clicks the Eula button, but the deeper I go the less I understand. I don't expect you to hold my hand, but in case you're curious (or in case someone is going to write up any documentation on this), here are my currently open issues:

1. How are the navigation buttons working? I searched the entire solution for NextButtonClick and found stuff, but I don't understand how it's working. Plus, if knew how to intercept the NetButtonClick event won't my code interfere with the proper operation of the control? I want to do custom stuff and afterward still advance to the next step.

2. I don't know what you're talking about when you mention the "current selected index property". There is a property called CurrentStepIndex, but it remains equal to zero regardless of what step I'm on. Maybe I'm supposed to be changing it? If so, where?

3. I'm not even sure what to do with properties and what with controls. For example, there's something called a WizardControl, which I presume is a control and has properties (like the one I mentioned in #2). There are also things called, e.g., StartStep, which I presume is also a control. I don't know, though, when I'm supposed to be concerned with the WizardControl or the StartStep (or LicenceStep, etc.).

4. I'm not clear on whether I have to add a new WizardControl to a new form for subsequent steps. I assume not -- that if I just add a new Intermediate Step then everything magically links together. But since I don't know the "magic" I don't know how and therefore don't know what I need to do in order to customize what happens when buttons at different Steps are clicked.

Since this topic is on Documentation, may I suggest that someone add a little documentation to include a few code snippets to show how to intercept a button click to do something simple like show a different MessageBox at different Steps. That would go a long way toward helping the newbies (like me) be able to effectively utilize this nice control.

Thank you.

modified on Saturday, February 9, 2008 5:54 PM

GeneralRe: Documentation? Pin
Manish Ranjan Kumar8-Feb-08 20:52
professionalManish Ranjan Kumar8-Feb-08 20:52 
AnswerRe: Documentation? Pin
Manish Ranjan Kumar8-Feb-08 20:51
professionalManish Ranjan Kumar8-Feb-08 20:51 
QuestionState Machine Pin
Gil Shimer7-Jan-08 23:18
Gil Shimer7-Jan-08 23:18 
GeneralGetting the Enter and Leave events for steps Pin
Dave Hary19-Dec-07 7:26
Dave Hary19-Dec-07 7:26 
QuestionWizardDemo.dll? Pin
JoeFarkas5611-Dec-07 10:40
JoeFarkas5611-Dec-07 10:40 
GeneralRe: WizardDemo.dll? Pin
La lola25-Mar-08 6:22
La lola25-Mar-08 6:22 
GeneralAnchor Problem for child controls on the wizardStep Pin
HirenKP24-Oct-07 10:37
HirenKP24-Oct-07 10:37 
GeneralRe: Anchor Problem for child controls on the wizardStep Pin
Patrick Ribbing26-Feb-08 22:31
Patrick Ribbing26-Feb-08 22:31 
GeneralRe: Anchor Problem for child controls on the wizardStep Pin
kochz6-Mar-08 5:30
kochz6-Mar-08 5:30 
GeneralRe: Anchor Problem for child controls on the wizardStep [modified] Pin
Stefan Müller26-May-08 2:35
Stefan Müller26-May-08 2:35 
GeneralRe: Anchor Problem for child controls on the wizardStep Pin
kochz26-May-08 5:00
kochz26-May-08 5:00 
AnswerRe: Anchor Problem for child controls on the wizardStep Pin
dtljf3-Sep-08 19:51
dtljf3-Sep-08 19:51 
Questionhi , pb with RightToLeft mode Pin
k_hammami20059-Oct-07 3:27
k_hammami20059-Oct-07 3:27 
GeneralConsider a CloseStep Page Pin
Tawani Anyangwe24-Sep-07 11:31
Tawani Anyangwe24-Sep-07 11:31 
GeneralRe: Consider a CloseStep Page Pin
f1prince31-Oct-07 15:04
f1prince31-Oct-07 15:04 
GeneralDesign time support for Data Sources Pin
fredsparkle6-Aug-07 12:40
fredsparkle6-Aug-07 12:40 
GeneralA suggestion Pin
Secrets18-Jul-07 2:52
Secrets18-Jul-07 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.