Click here to Skip to main content
14,303,059 members

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

Rate this:
4.65 (131 votes)
Please Sign up or sign in to vote.
4.65 (131 votes)
4 Feb 2008CPOL
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)

Share

About the Author

Manish Ranjan Kumar
Software Developer (Senior)
India India
No Biography provided

Comments and Discussions

 
QuestionRe: error Pin
10e9-Apr-08 7:24
member10e9-Apr-08 7:24 
GeneralRe: error Pin
Pusmiq745-May-08 20:39
memberPusmiq745-May-08 20:39 
QuestionDocumentation? Pin
dysert8-Feb-08 7:22
memberdysert8-Feb-08 7:22 
GeneralRe: Documentation? Pin
Wes Aday8-Feb-08 9:31
professionalWes Aday8-Feb-08 9:31 
GeneralRe: Documentation? Pin
dysert8-Feb-08 9:59
memberdysert8-Feb-08 9:59 
GeneralRe: Documentation? Pin
Wes Aday8-Feb-08 10:10
professionalWes Aday8-Feb-08 10:10 
GeneralRe: Documentation? Pin
dysert8-Feb-08 10:49
memberdysert8-Feb-08 10:49 
GeneralRe: Documentation? Pin
Wes Aday8-Feb-08 14:31
professionalWes Aday8-Feb-08 14:31 
Okay I have looked at this for a bit. Maybe I can help you out a bit now. Please don't take any offense to anything that I write.

dysert wrote:
intercept the NextButtonClick

dysert wrote:
I tried to replicate it in my project



From this and the fact that you are "new" I have come up with a theory. I am going to go with that and leave it up to you to decide if it's right or not. Now, since you could not replicate the event handler, my thought is that you copy/pasted from the demo. Well, there are 2 parts to the event handler. There is the:
private void demoWizard_FinishButtonClick(object sender, EventArgs e)
 {
     MessageBox.Show("Finishing the wizard.");
     Close();
 }


If that is all you do, the event won't get fired because it hasn't been added yet. You also need something that looks like:

this.wizardControl1.FinishButtonClick += new System.EventHandler(this.demoWizard_FinishButtonClick);

which "wires" the event to the handler.

The easiest way to add the event handlers for this code seems to be:
Select the control in the designer,
click the Events button (looks like a lightning bolt) in the Properties window
then find the event you want to handle, for you example the event you want to handle is named "NextButtonClick"
Double click in the column next to the event and the event handler will be created for you.

The second part is, you would add the controls the same way you would add any other control. If you look at the first graphic under Step 3, you can see the there is a section named "Step navigation" under the smart tag. Navigate to the step you want to add a control to then drag and drop a control onto the designer for the step. Make sure that the control is above the next-button-control area. The panels of the wizard will contain the control and you can handle the controls directly in your form class. The wizard has a CurrentStepIndex property that will allow you to know which step you are on.

Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns

GeneralRe: Documentation? Pin
dysert8-Feb-08 15:22
memberdysert8-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
memberdysert8-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
memberdysert9-Feb-08 11:44 
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
memberGil Shimer7-Jan-08 23:18 
GeneralGetting the Enter and Leave events for steps Pin
Dave Hary19-Dec-07 7:26
memberDave Hary19-Dec-07 7:26 
QuestionWizardDemo.dll? Pin
JoeFarkas5611-Dec-07 10:40
memberJoeFarkas5611-Dec-07 10:40 
GeneralRe: WizardDemo.dll? Pin
La lola25-Mar-08 6:22
memberLa lola25-Mar-08 6:22 
GeneralAnchor Problem for child controls on the wizardStep Pin
HirenKP24-Oct-07 10:37
memberHirenKP24-Oct-07 10:37 
GeneralRe: Anchor Problem for child controls on the wizardStep Pin
Patrick Ribbing26-Feb-08 22:31
memberPatrick Ribbing26-Feb-08 22:31 
GeneralRe: Anchor Problem for child controls on the wizardStep Pin
kochz6-Mar-08 5:30
memberkochz6-Mar-08 5:30 
GeneralRe: Anchor Problem for child controls on the wizardStep [modified] Pin
Stefan Müller26-May-08 2:35
memberStefan Müller26-May-08 2:35 
GeneralRe: Anchor Problem for child controls on the wizardStep Pin
kochz26-May-08 5:00
memberkochz26-May-08 5:00 
AnswerRe: Anchor Problem for child controls on the wizardStep Pin
dtljf3-Sep-08 19:51
memberdtljf3-Sep-08 19:51 

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.

Article
Posted 6 May 2007

Stats

460.8K views
13.4K downloads
382 bookmarked