StrataFrame Forum

StrataFrame Wizard Control and error control

http://forum.strataframe.net/Topic14141.aspx

By Mike Rogers - 2/6/2008

I have a field that is required to be completed before moving to the next page.

Private Sub WizardControl1_NextClicked(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.NextBackEventArgs) Handles WizardControl1.NextClicked

If txtRecordSourceName.Text = "" Then

                        EVGCI.MessageDialog(AppError, "ERROR", "Please Select a Record Source before clicking Next")

bolError = True

WizardControl1.CurrentPageIndex = 0

WizardControl1.MoveToPreviousPage()

WizardControl1.MoveToLastPage()

End If

End Sub

 

I need to force the wizard control to stay on the current page if you have incomplete fields.

Thanks Mike

By Trent L. Taylor - 2/6/2008

Mike, the two are not actually conntected.  All you need to do to prevent navigation is handle the NextClicked event on the Wizard Control or the WizardPage (either one depending on your needs) and set the CancelNavigation event arg to True:


Private Sub WizardControl1_NextClicked(ByVal e As NextBackEventArgs) Handles WizardControl1.NextClicked
        e.CancelNavigation = True
End Sub
By Mike Rogers - 2/6/2008

Thanks Trent,  works like a charm.
By Trent L. Taylor - 2/6/2008

No problem Smile