Click here to Skip to main content
11,802,762 members (71,229 online)
Click here to Skip to main content

GN Wizard Framework

, 21 Dec 2006 CPOL 121.7K 1.2K 91
Rate this:
Please Sign up or sign in to vote.
A simple Wizard framework.


This article will help you give your application a common wizard interface. One of the main reasons wizards were invented was to make common tasks easier to work with.


The idea for my wizard came soon after I realized I was reproducing code to do the same thing again and again! As working with database applications is my main job, the need for wizard based procedures kept arising more and more. I felt the need to create a common wizard interface to suit my needs.


Just drop the WizardTemplate control on a form, and you are ready to go.


  • Add the control to the toolbox (GNWizardFrameWork.dll).
  • Drop the WizardTemplate on a WinForm.
  • Add the pages
  • You are done!

Points of interest

The wizard component is written in VB.NET and inherits from UserControl. Attached to the wizard is a 3DLine control.

Page Layouts

Wizards usually have two different page layouts, one for exterior pages (the main/welcome page), and one for interior pages (the individual steps within the first and last pages).

Exterior Pages

Exterior pages usually have a sidebar graphic with a boxed logo. The GNWizardFramework doesn't support this; instead, I have made the exterior page as a blank canvas so the developer can set the complete layout, and not be limited to having a sidebar they might not want.

Interior Pages

The interior pages are pretty much the same as the exterior pages except for a few minor alterations. Firstly, as exterior pages fill the whole wizard except for the button bar based at the bottom of the wizard, the interior pages have a header panel, and the working panel locations is compensated by a header.

PageStyle enum

  • eWPS_Interior

    The wizard and page should be formatted as an interior page.

  • eWPS_Exterior

    The wizard and page should be formatted as an exterior page.

How the code is brought together

The wizard consists of three classes and two controls:

Class/Control Description
WizardTemplateDesigner (class) Designer for the Wizard template
WizardPage (class) Wizard page item
WizardPageCollection (class) Holds all the WizardPage details, and handles all events passed by a WizardPage
WizardTemplate (control) Wizard control
ThreeDLine (control) Simple 3D line control

Handling buttons

All pages (interior and exterior) have their own button handlers. Buttons can be accessed by the page you want to change or set:

WelcomePage.HasNextButton = True
WelcomePage.HasPreviousButton = False
WelcomePage.HasCancelButton =True
WelcomePage.HasFinishButton = False

Main Features

  • Easy to use: Simple design-time interface.
  • GUI: An easy to use GUI, what you see at design-time is what you see at runtime.
  • PC Support: Works under (tested so far) Win95/98, WinXP, Win2000, and Win2003 Server

Other Features

  • Runtime customization: You can change any part of the wizard at runtime.
  • Attach/add pages at runtime:
    'Inserting a custom page At runtime:
    '-- Inserts A New Page after the Current Page
      WizardTemplate.Pages.IndexOf(CurrentWizPanel) + 1, _
    'Adding a custom page At runtime:
    '-- Adds A New Page To The End Of The wizard


Not much here to learn from, but hopefully the library will be of some use. As this is my first article, please be lenient. I hope all of you at least enjoyed reading the article, and maybe you'll find the framework useful.

Licence (LGPL)

The GNWizardFramework library is copyright 2005-2006 to Gary Noble, but its source code and the binaries are free for commercial and non commercial use.

Only vote for this article if you like the library.


  • 1.01 (21-Dec-2006)
    • Updated the 'Previous Button' disabled issue pointed out by Bill Reinhold (Thanks Bill).
    • Updated the 'Toolbox bitmap' - Toolbox bitmaps are now handled properly.
  • 1.0 (21-Mar-2006) - Initial release.


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


About the Author

Gary Noble
Software Developer
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralRe: Change wizardpages Pin
Gary Noble12-Jun-06 22:48
memberGary Noble12-Jun-06 22:48 
GeneralRe: Change wizardpages Pin
numlocked24-Jul-06 6:49
membernumlocked24-Jul-06 6:49 
AnswerRe: Change wizardpages Pin
The JZ14-Aug-06 9:22
memberThe JZ14-Aug-06 9:22 
AnswerRe: Change wizardpages Pin
Random@Redgum20-Jun-07 14:31
memberRandom@Redgum20-Jun-07 14:31 
GeneralRe: Change wizardpages Pin
samccabe7-Sep-07 7:58
membersamccabe7-Sep-07 7:58 
GeneralCrash Pin
codepuncher30-May-06 16:06
membercodepuncher30-May-06 16:06 
GeneralRe: Crash Pin
Gary Noble30-May-06 22:28
memberGary Noble30-May-06 22:28 
GeneralRe: Crash Pin
codepuncher2-Jun-06 18:35
membercodepuncher2-Jun-06 18:35 
Well it turned out that the problem is with the VS2003 editor not the wizard control. The section of code that sets up the form and the resx file got corrupted while editing controls on the wizard pages. Nothing I was editing really stands out at the cause but I did find a couple of newsgroup posts referencing VS corrupting the resx and/or form initialization code at seeminly random intervals. I was able to recover by deleting the resx and editing and correcting the form code outside the editor and then bringing it back in to VS.

On another note, I really like the wizard, it makes writing them so mich easier. Thanks.Big Grin | :-D

GeneralRe: Crash Pin
codepuncher28-Jun-06 13:48
membercodepuncher28-Jun-06 13:48 
GeneralRe: Crash Pin
defiant7123-Nov-06 12:05
memberdefiant7123-Nov-06 12:05 
GeneralRe: Crash Pin
simohack5-Mar-07 4:32
membersimohack5-Mar-07 4:32 
GeneralRe: Crash Pin
trej12-Apr-07 0:57
membertrej12-Apr-07 0:57 
QuestionHaving trouble using wizard Pin
bryndabella30-May-06 8:08
memberbryndabella30-May-06 8:08 
AnswerRe: Having trouble using wizard Pin
Gary Noble30-May-06 22:41
memberGary Noble30-May-06 22:41 
GeneralRe: Having trouble using wizard Pin
bryndabella31-May-06 12:39
memberbryndabella31-May-06 12:39 
GeneralGreat Work Pin
_brett_24-May-06 22:00
member_brett_24-May-06 22:00 
GeneralBefore Move Next Pin
barrett23621-Apr-06 3:58
memberbarrett23621-Apr-06 3:58 
QuestionSkip a page? Pin
unique_246-Apr-06 0:30
memberunique_246-Apr-06 0:30 
AnswerRe: Skip a page? Pin
GaryN6-Apr-06 2:06
memberGaryN6-Apr-06 2:06 
GeneralRe: Skip a page? Pin
unique_247-Apr-06 20:18
memberunique_247-Apr-06 20:18 
GeneralRe: Skip a page? Pin
bryndabella2-Jun-06 13:04
memberbryndabella2-Jun-06 13:04 
GeneralAwesome Pin
Itsy Bitsy27-Mar-06 2:52
memberItsy Bitsy27-Mar-06 2:52 
GeneralRe: Awesome Pin
GaryN27-Mar-06 6:54
memberGaryN27-Mar-06 6:54 
GeneralGreat Work! Pin
RandD Software22-Mar-06 21:58
memberRandD Software22-Mar-06 21:58 
QuestionDoes it crash? Pin
Infotech Belgaum22-Mar-06 20:48
memberInfotech Belgaum22-Mar-06 20:48 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151002.1 | Last Updated 21 Dec 2006
Article Copyright 2006 by Gary Noble
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid