dahall / AeroWizard

Library for easy creation of custom and Aero Wizards. Aero Wizard strictly follows Microsoft guidelines and uses Visual Styles to get visual theming.
MIT License
112 stars 32 forks source link

Next Button Issues When Inserting Pages #29

Closed dahall closed 6 years ago

dahall commented 6 years ago

I discovered a bug that occurs during the WizardPage.Commit event.

If you Insert pages during the Commit event that appear after the WizardPage that just triggered the Commit event then it skips past all the inserted WizardPage controls.

For example:

Private Sub WizardPage1_Commit(sender As Object, e As AeroWizard.WizardPageConfirmEventArgs) Handles WizardPage1.Commit
    Dim pages As List(Of AeroWizard.WizardPage) = New List(Of AeroWizard.WizardPage)

    'Dynamically create the WizardPages
    Dim row As DataRowView
    For Each index As Integer In checkedListBox.SelectedIndices
        row = DirectCast(checkedListBoxCameras.Items(index), DataRowView)
        pages.Add(CreateCameraWizardPage(row("Name").ToString, row("IpAddress").ToString))
    Next

    'Insert the pages
    WizardControl1.Pages.InsertRange(2, pages)
End Sub

That event will skip all pages inserted to select the page that appeared next in the designer.

Originally posted: 2016-11-23T19:24:30

dahall commented 6 years ago

Check to make sure the NextPage property on your current page is set to null or set to the first page you've inserted.

Originally posted: 2017-01-12T12:14:35

dahall commented 6 years ago

No response.

Originally posted: 2017-03-13T11:21:20