![]() |
Languages »
VB.NET »
General
Intermediate
License: The Code Project Open License (CPOL)
GN Wizard FrameworkBy Gary NobleA simple Wizard framework. |
VB.NET 1.1, .NET 2.0, Win2K, WinXP, Win2003VS.NET2003, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

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.
WizardTemplate on a WinForm.
The wizard component is written in VB.NET and inherits from UserControl. Attached to the wizard is a 3DLine control.
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 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.
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.
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.


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 |
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
'Inserting a custom page At runtime:
'-- Inserts A New Page after the Current Page
WizardTemplate.Pages.Insert(_
WizardTemplate.Pages.IndexOf(CurrentWizPanel) + 1, _
NewWizardPage)
'Adding a custom page At runtime:
'-- Adds A New Page To The End Of The wizard
WizardTemplate.Pages.Add(NewWizardPage)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.
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.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 21 Dec 2006 Editor: Smitha Vijayan |
Copyright 2006 by Gary Noble Everything else Copyright © CodeProject, 1999-2009 Web17 | Advertise on the Code Project |