Results 1 to 40 of 64

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

Threaded View

  1. #9

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

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

    Alright, I have updated the WizardCtrl class. Instead of just a 'cancel' boolean, I decided to use custom Event Arguments that hold a "Cancel" property, and also a "CurrentPage" property that holds the current page.

    This way, you can use the BeforeNextButton_Clicked event as such:
    vb.net Code:
    1. Private Sub WizardCtrl1_BeforeNextButton_Clicked(ByVal sender As System.Object, ByRef e As WizardControlExample.BeforeNextButtonEventArgs) Handles WizardCtrl1.BeforeNextButton_Clicked
    2.         'Check current page
    3.         If e.CurrentPage Is Me.WizardPage3 Then
    4.  
    5.             'Validate info on current page
    6.             If TextBox1.Text = "Hello World" Then
    7.                 e.Cancel = False
    8.             Else
    9.                 e.Cancel = True
    10.             End If
    11.         End If
    12.     End Sub
    Assuming you have a TextBox1 on WizardPage3, whose text should be "Hello World". If it's text is not "Hello World" the Next button click should be canceled.


    Since I am no longer running Vista, I am getting some problems with missing DLL files in my project on XP. I have never seen them before, but I'll look into them, I want this project to work on XP as well (obviously without Aero Glass).

    This stops me from uploading the entire project however, so I have just attached the new 'WizardCtrl.vb' class. Replace the old 'WizardCtrl.vb' class with this new one. The only changes are the Before___ events.

    In case you have already changed some of the WizardCtrl class and don't want to lose your work, you can open up my new WizardCtrl class and copy/paste the following sections into your custom WizardCtrl class:
    - Under the 'Events' region: The 3 "Delegate" subs + the 3 Before___ events (lines 17 to 37).
    - The btnNext_Click, btnPrev_Click and btnCancel_Click events are updated; view my changes and modify your own as needed (lines 303 to 336).
    - The entire (new) 'Event Handlers' region containing three new classes (lines 597 to 641).


    Hope you are satisfied with the changes!
    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