Results 1 to 40 of 64

Thread: [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support!

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    [2008][UPDATE, Aero Glass] Wizard Template UserControl - Full Design-time support!

    Hi,

    This is my latest UserControl: a Wizard template with full Design-time support.

    Besides being a very useful control if you ever want to create a Wizard (no longer do you have to mess around with Panels, making them (In)Visible manually whenever you want to add a control...), this is also a very good lesson on Designers, and the use of Smart-Tags etc.


    Drop the control onto your form, add pages as you desire and browse through them using the Next/Back buttons (during Design-time!). Change the Title / Description / Icon of every page and simply drag & drop the required controls onto the page, just like in a TabControl!


    Here is a description with screenshots:

    The main control is the WizardCtrl usercontrol. This is the control you drop onto your form. It contains three basic regions:
    • Header (Title, Description and Icon display)
    • PagesPanel (Hosts all the pages)
    • Navigation panel (Cancel, Back, Next, Finish buttons)


    The PagesPanel is a simple Panel that will host the WizardPages. A WizardPage is a usercontrol inheriting from the Panel and can host whichever control you want to put on that page.

    When you add the WizardCtrl to your form, a new WizardPage is automatically added:


    As you can see, there is no Header panel (Title/Description). This is because the first page is by default a Welcome page and no header is displayed. Change the IsWelcomePage property manually if you don't need a Welcome page.

    As soon as you add a new page, a normal page is added:


    As you can see, the Header panel displays the default Title and Description, and I manually added an Icon. The Icon is invisible when there is no Icon specified.

    To add pages, remove pages or select a different page, you can use the WizardCtrl Smart Tags:


    You can also browse through the pages using the Next/Back buttons, just like you can during Run-time.

    To change common properties such as Title, Description and Icon, you can use the WizardPage Smart Tags:


    Besides the 'Welcome Page' property, there is also the 'Last Page' property. When True, this will change the text of the Next button to Finished (or whatever you have specified as FinishedButtonText).

    Finally, there is a small control called ThreeDLine that draws a 3d-border line, as can be seen during Run-time:



    There are a number of properties you can use to change the appearance of the WizardCtrl, such as the NextButtonText, BackButtonText, CancelButtonText and FinishedButtonText (these are self-explanatory I hope).

    There are also a number of (also self-explanatory) Events you can use such as the NextButtonClicked, BackButtonClicked, CancelButtonClicked and SelectedIndexChanged events.



    Besides the Controls explained above, there are also two Designers. The Designers create the Smart-Tags, and more importantly allow the Next and Back buttons to be used during Design-time.

    Finally, the Misc.vb file contains two miscellaneous classes, one to take care of type conversion to a WizardPage, and the other to take care of the 'Pages' CollectionEditor.


    I have attached an Example project (created in VS2008) for you to use (you may need to Build the solution to get rid of any errors). If you don't have VS2008 you can simply start a new project and add the separate classes manually:
    • WizardCtrl.vb
    • WizardPage.vb
    • WizardCtrlDesigner.vb
    • WizardPageDesigner.vb
    • Misc.vb



    That's about it... If you have any questions, let me know. If you found a bug, let me know. If you have any suggestions, let me know!
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width