WPF随笔

导航

Wizard in C#

Wizard in C#

 

As we know there is no wizard class in .net framework. I just write two classes for control wizard in C#.

The code list here.

 

1, BaseWizardForm: The wizard each page’s base form

The form will auto generate the wizard step button, you can set the button type in the derived form class.

BaseWizardForm

2, WizardController used to contol which wizard form to display

You can create new wizard control class from this class and control your wizard step yourself by override NextStep and PreStep.

WizardControl

3 How to use.

   A, Create new forms derived from BaseWizardForm and set the forms' WizardButton Property.

   B, Create a new class derived from WizardController and add the forms to the controller.

       public TestWizardController()
        {
            this.AddForm(typeof(Form1));
            this.AddForm(typeof(Form2));
        }

   C, Show the wizard

       TestWizardController test = new TestWizardController()

       test.ShowDialog(null);

posted on 2010-04-12 19:23  Jeffery Sun  阅读(1588)  评论(0编辑  收藏  举报