Identifying which button is clicked(Back or Next)?

Wizard for WPF Forum

Posted 14 years ago by Doraiswamy
I am trying to do validation and i tried as the code given in the Actipro document

private void wizard_SelectedPageChanging(object sender, WizardSelectedPageChangeEventArgs e) {
if (e.OldSelectedPage == dataEntryPage) {
// some length validation


This is working fine if i click "Next" button but this validation occurs even while i use "Back" button.

Is there any way to restrict this?. I am trying to use WizardPageSelectionFlags to know whether back or forward page is requested but in vain?. Any suggestion please.

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
You can use code like this to know if you are moving backwards and then filter out your code based on that:
bool isBackwardProgress = ((e.SelectionFlags & WizardPageSelectionFlags.BackwardProgress) == WizardPageSelectionFlags.BackwardProgress);

Actipro Software Support

Posted 14 years ago by Doraiswamy
much thanks. I really missed and overlooked.
The latest build of this product (v24.1.2) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.