Nielsen's Weblog : .NET [use your Context dude]
Updated: 26-03-2006; 14:14:19.

 

Subscribe to "Nielsen's Weblog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

8. december 2005

Have you ever found your self wandering sleepless around in this directory here :

"C:Program FilesCommon FilesMicrosoft SharedHelp 8" and stumbled over this assembly here:
Microsoft.WizardFramework.dll

Yeah right that's the .Net 2.0 Wizard framework, its not documented yet, so Reflector.exe is your best option here (as usual).

Here is how I got a descent Wizard to work:
Create an 'inherited Form' that derives from the WizardForm like this:

 public partial class WizardFrm : Microsoft.WizardFramework.WizardForm
 {
 .....
 
Create some wizard pages, this is best done by creating an 'Inherited User Control' which derives from WizardPage like this:

public partial class Page1 : Microsoft.WizardFramework.WizardPage
{
        public Page1(WizardForm wizard):base(wizard)
        {
            InitializeComponent();
        }
.....

Now in the WizardFrm's ctor add your WizardPages like this:

public WizardFrm()
{
      InitializeComponent();
      p1 = new Page1(this);
      this.AddPage(p1);
      p2 = new Page2(this);
      this.AddPage(p2);
      p3 = new Page3(this);
      this.AddPage(p3);
}
´
private void WizardFrm_Load(object sender, EventArgs e)
{
      EnableButton(ButtonType.Next, true);
}


Invoke your wizard from in your app like this :

WizardFrm frm = new WizardFrm();
frm.Start();

Now when you design the individual WizardPages set the 'infoPanel.Dock' to Fill, this will let you add your controls to the wizard page. Set the WizardPage.StepTitle to a description that this WizardPage represents.

I was not able to find any Events like OnNext, OnPrev etc. This makes it hard to validate a WizardPage there by defeating the whole purpose of a Wizard...I am sure that deep down in the WizardForm or in the 'NavigationButtonBar' its possible to catch these events ...I didn't proceed that far for now.

I wonder why this WizardFramework isn't documented, I sure do hope they make it official ...I have been missing that Wizard since the good old MFC days.

contact me if you need the sourcecode.

"One of the secrets of life is to make stepping stones out of stumbling blocks"
-- Jack Penn


 


2:25:32 PM    comment []

© Copyright 2006 Allan Nielsen.



Click here to visit the Radio UserLand website.
 


December 2005
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Nov   Mar