vb.netwizarddotnetbar

Remove WizardPage from Wizard dotnebar vb.net


I am using the dotnetbar libray, I added one wizardpage during design time and some others during run-time, then a final one after the user gets to the end of the wizard and I used a command to automatically switch to the newly (last) created wizardpage. I used the following code to remove the other wizardpages except the current selected page.

Dim wiz As New DevComponents.DotNetBar.WizardPage 'pages
    With wiz
        .InteriorPage = True
        .Name = "Summary"
        .PageTitle = "Summary"
        .PageDescription = "Details of the Summary."
        .Controls.Add(lbl1)
        .Controls.Add(lbl2)
        .Controls.Add(lbl3)
        .Controls.Add(lbl4)
        .Controls.Add(lbl5)
        .Controls.Add(lbl6)
        .Controls.Add(gp)
    End With
    CBTWizard.WizardPages.Add(wiz)
    CBTWizard.Refresh()

    CBTWizard.SelectedPage = wiz

    Dim c1 As Control
    Dim c2 As Control
    For Each c1 In CBTWizard.Controls
        If TypeOf c1 Is DevComponents.DotNetBar.WizardPage Then
            If c1.Name <> "Summary" Then
                CBTWizard.WizardPages.Remove(c1)
            End If
        End If
        CBTWizard.Refresh()
    Next

Problem: I want to the Wizard to rearrange so that It no longer show the Back button, kind of the Wizard refresh to show the presence of only one wizardpage remaining.


Solution

  • I got a work around, instead of rearranging the order, I simply made the back button, next button invincible and I disabled the Finish button. The logic flow worked that way.

     With wiz
            .InteriorPage = True
            .Name = "Summary"
            .PageTitle = "Summary"
            .PageDescription = "Details of Summary."
            .Controls.Add(lbl1)
            .Controls.Add(lbl2)
            .Controls.Add(lbl3)
            .Controls.Add(lbl4)
            .Controls.Add(lbl5)
            .Controls.Add(lbl6)
            .Controls.Add(gp)
            .FinishButtonEnabled = DevComponents.DotNetBar.eWizardButtonState.False
            .BackButtonVisible = DevComponents.DotNetBar.eWizardButtonState.False
            .NextButtonVisible = DevComponents.DotNetBar.eWizardButtonState.False
        End With
    

    These I added only to the last created wizardpage.