Click here to Skip to main content
15,887,683 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 537.7K   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

 
GeneralMy vote of 2 Pin
#realJSOP5-Dec-08 10:49
mve#realJSOP5-Dec-08 10:49 
GeneralDesign support for steps Pin
Giorgi Dalakishvili26-Nov-08 22:58
mentorGiorgi Dalakishvili26-Nov-08 22:58 
GeneralError i wizard Pin
Member 237150223-Oct-08 10:16
Member 237150223-Oct-08 10:16 
GeneralRe: Error i wizard Pin
Frits van Soldt10-Nov-08 22:38
Frits van Soldt10-Nov-08 22:38 
GeneralSetting CurrentStepIndex Pin
dave5280312-Oct-08 17:12
dave5280312-Oct-08 17:12 
GeneralRe: Setting CurrentStepIndex Pin
gujavierdra6-Aug-09 13:23
gujavierdra6-Aug-09 13:23 
Generalshortcuts and tootips Pin
lahori boy16-Sep-08 3:28
lahori boy16-Sep-08 3:28 
GeneralFeels unfinished Pin
Richard Grenfell13-Aug-08 12:02
Richard Grenfell13-Aug-08 12:02 
I went to put together a basic wizard form. I'd read the issue already mentioned that people had had errors about serialization with the LeftPair, but found myself wanting to change that value. I'd built the project and had used only a DLL reference to the resulting DLL and still had the same issue previously mentioned. I tried bringing it into the same solution, still no go. I can't modify that value or the data fails to save. I tried playing with Serialization attributes and figuring out what the true cause was, finally threw up my hands saying, the point of using a pre-built wizard control was to save time, not use it up. So I put that aside and looked at some other things.

I quickly noticed having changed the subtitle text to be more than one line that for the first line the shadow was on target, but the following line it rendered with a different offset. Back and forth it went every other line. I debugged and found that it was using floating math for each line independently. So one line would offset the shadow to 31.75 and the next to 31.19 causing a full pixel rounding difference on each line. To fix this, it needs to pre-compute a fixed size offset that all lines will use to get the text to render consistently.

I also noticed an odd coding pattern:

int Property
{
   get { return base.Property; }
   set
   {
      base.Property = value;
      base.Property = 0;  // Some fixed value
   }
}


I believe the author was a user of ReSharper (a good thing), and didn't want to see the warning about the lack of use of value, but wanted to force the property to a fixed value so didn't want to use the value provided. Elsewhere the author used the ReSharper "exclude warning" pragmas to accomplish the same thing, so I wonder why not here as well rather than double assignment.

Later I closed and re-opened my form, and boom, exception on load about reference to the DLL. Try to load the form again, it works. It was an intermittent issue. It sounded a lot like the one earlier post regarding having changed the sub-title.

All in all, the implementation looks really nice, but it just doesn't feel finished yet. There are too many little points I would feel the need to debug to put this into an application I would use and attempt to maintain. I wish this implementation the best, but am personally not ready to use it in its current state.
GeneralLocalizable attribute Pin
Stonkie11-Aug-08 11:51
Stonkie11-Aug-08 11:51 
GeneralTrying to understand the following code... Pin
Keith Yerian3-Aug-08 6:57
Keith Yerian3-Aug-08 6:57 
GeneralRe: Trying to understand the following code... Pin
Stonkie11-Aug-08 11:49
Stonkie11-Aug-08 11:49 
QuestionStepIndex always -1? Pin
Stonkie22-Jul-08 12:08
Stonkie22-Jul-08 12:08 
GeneralEvent NextButton other Button Pin
vitor.dumont18-Jul-08 3:54
vitor.dumont18-Jul-08 3:54 
GeneralSuggested Improvement Pin
michieldejong16-Jul-08 4:14
michieldejong16-Jul-08 4:14 
GeneralError in Designer Pin
Serge Desmedt16-Jul-08 3:32
professionalSerge Desmedt16-Jul-08 3:32 
QuestionAdding steps in run time? Pin
Parameshwaran Venkataraman14-Jul-08 1:26
Parameshwaran Venkataraman14-Jul-08 1:26 
GeneralAgreementChangedEvent is not working Pin
Lavanya Jagadeesan13-Jul-08 23:38
Lavanya Jagadeesan13-Jul-08 23:38 
QuestionError: System.IO.FileNotFoundException after changing subtitle Pin
Paul Meems9-May-08 9:10
Paul Meems9-May-08 9:10 
AnswerRe: Error: System.IO.FileNotFoundException after changing subtitle Pin
Manish Ranjan Kumar28-May-08 4:26
professionalManish Ranjan Kumar28-May-08 4:26 
QuestionError setting LeftPair Pin
Member 4916597-May-08 10:10
Member 4916597-May-08 10:10 
AnswerRe: Error setting LeftPair Pin
Manish Ranjan Kumar28-May-08 4:22
professionalManish Ranjan Kumar28-May-08 4:22 
GeneralRe: Error setting LeftPair Pin
#realJSOP8-Dec-08 8:30
mve#realJSOP8-Dec-08 8:30 
AnswerRe: Error setting LeftPair Pin
voxxde23-Sep-09 10:27
voxxde23-Sep-09 10:27 
AnswerRe: Error setting LeftPair Pin
smummaneni22-Oct-09 7:17
smummaneni22-Oct-09 7:17 
GeneralRe: Error setting LeftPair Pin
spencepk1-Mar-10 6:53
spencepk1-Mar-10 6:53 

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.