Posted 19 years ago
		by Richard Bysouth
	

Hi
In my wizard page-handling code I have been using the SelectionChanging event to control the setting up of the next wizard page according to previous selections. This includes setting the visibility of certain controls. However, I have noticed that while in this event, all controls on the new wizard page are visible=false.
Am I supposed to be using the SelectionChanged event for code that initialises a page? One of the reasons I've been using SelectionChanging is because I don't want the code to be executed if navigating backwards through pages, so have used something like "If e.Reason = ActiproSoftware.Wizard.WizardPageEventReason.BackButtonClick Then Exit Sub".
I have tried calling the page initialisation code from SelectionChanged but have noticed there is a lot of flicker from the controls (have tried using SuspendLayout on the wizard page with no difference).
Ideally, I'd like to leave the page initialisation code in SelectionChanging, however I still need to ensure controls are visible according to previous selections.
A sample of my code:Thanks
Richard
[Modified at 05/09/2006 12:31 AM]
In my wizard page-handling code I have been using the SelectionChanging event to control the setting up of the next wizard page according to previous selections. This includes setting the visibility of certain controls. However, I have noticed that while in this event, all controls on the new wizard page are visible=false.
Am I supposed to be using the SelectionChanged event for code that initialises a page? One of the reasons I've been using SelectionChanging is because I don't want the code to be executed if navigating backwards through pages, so have used something like "If e.Reason = ActiproSoftware.Wizard.WizardPageEventReason.BackButtonClick Then Exit Sub".
I have tried calling the page initialisation code from SelectionChanged but have noticed there is a lot of flicker from the controls (have tried using SuspendLayout on the wizard page with no difference).
Ideally, I'd like to leave the page initialisation code in SelectionChanging, however I still need to ensure controls are visible according to previous selections.
A sample of my code:
    Private Sub wizWizard_SelectionChanging(ByVal sender As Object, ByVal e As ActiproSoftware.Wizard.WizardPageCancelEventArgs) Handles wizWizard.SelectionChanging
        If e.Reason = ActiproSoftware.Wizard.WizardPageEventReason.BackButtonClick Then Exit Sub
            'set up the controls on the new step in the wizard
            Select Case wizWizard.SelectedPage.Name
                Case wpReportingOptions.Name
                    SetupReportingOptionsPage()
                'other cases removed
            End select
    End Sub
Private Sub SetupReportingOptionsPage()
      'set control visibility according to options selected on previous pages
      lblDescription.Visible = someValueOnPreviousPage
      'TODO: the setting of the above value is ignored here
      'something to do with the wizard page not being initialised yet
end sub
Richard
[Modified at 05/09/2006 12:31 AM]
