Posted 20 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC
I recently tried to create a Wizard page that only had a 'Finish' button. The following code was placed in the 'OnSelectionChanged' override for the Wizard:
this.Wizard.BackButtonEnabled = false;
this.Wizard.NextButtonEnabled = false;
this.Wizard.FinishButtonEnabled = true;
this.Wizard.CancelButtonEnabled = false;
this.Wizard.SelectedPage.BackButtonVisible = false;
this.Wizard.SelectedPage.NextButtonVisible = false;
this.Wizard.SelectedPage.FinishButtonVisible = true;
this.Wizard.SelectedPage.CancelButtonVisible = false;
This code resulted in only the 'Finish' button being displayed, but the button was not enabled. I then modified the above code so that the cancel button would be visible (but not enabled):
this.Wizard.BackButtonEnabled = false;
this.Wizard.NextButtonEnabled = false;
this.Wizard.FinishButtonEnabled = true;
this.Wizard.CancelButtonEnabled = false;
this.Wizard.SelectedPage.BackButtonVisible = false;
this.Wizard.SelectedPage.NextButtonVisible = false;
this.Wizard.SelectedPage.FinishButtonVisible = true;
this.Wizard.SelectedPage.CancelButtonVisible = true;
This code resulted in both the 'Finish' button and the 'Cancel' button being displayed. The 'Finish' button was still disabled, but the 'Cancel' button was now enabled (opposite of what was expected). I then modified the code so that both the cancel button and finish button should be visible and enabled:
this.Wizard.BackButtonEnabled = false;
this.Wizard.NextButtonEnabled = false;
this.Wizard.FinishButtonEnabled = true;
this.Wizard.CancelButtonEnabled = true;
this.Wizard.SelectedPage.BackButtonVisible = false;
this.Wizard.SelectedPage.NextButtonVisible = false;
this.Wizard.SelectedPage.FinishButtonVisible = true;
this.Wizard.SelectedPage.CancelButtonVisible = true;
The result didn't change. Both buttons visible, only 'Cancel' button was enabled.
I've actually changed my approach to just use a single 'Cancel' button (this is probably what I should have done anyway), but I thought I'd still bring this to your attention.
this.Wizard.BackButtonEnabled = false;
this.Wizard.NextButtonEnabled = false;
this.Wizard.FinishButtonEnabled = true;
this.Wizard.CancelButtonEnabled = false;
this.Wizard.SelectedPage.BackButtonVisible = false;
this.Wizard.SelectedPage.NextButtonVisible = false;
this.Wizard.SelectedPage.FinishButtonVisible = true;
this.Wizard.SelectedPage.CancelButtonVisible = false;
This code resulted in only the 'Finish' button being displayed, but the button was not enabled. I then modified the above code so that the cancel button would be visible (but not enabled):
this.Wizard.BackButtonEnabled = false;
this.Wizard.NextButtonEnabled = false;
this.Wizard.FinishButtonEnabled = true;
this.Wizard.CancelButtonEnabled = false;
this.Wizard.SelectedPage.BackButtonVisible = false;
this.Wizard.SelectedPage.NextButtonVisible = false;
this.Wizard.SelectedPage.FinishButtonVisible = true;
this.Wizard.SelectedPage.CancelButtonVisible = true;
This code resulted in both the 'Finish' button and the 'Cancel' button being displayed. The 'Finish' button was still disabled, but the 'Cancel' button was now enabled (opposite of what was expected). I then modified the code so that both the cancel button and finish button should be visible and enabled:
this.Wizard.BackButtonEnabled = false;
this.Wizard.NextButtonEnabled = false;
this.Wizard.FinishButtonEnabled = true;
this.Wizard.CancelButtonEnabled = true;
this.Wizard.SelectedPage.BackButtonVisible = false;
this.Wizard.SelectedPage.NextButtonVisible = false;
this.Wizard.SelectedPage.FinishButtonVisible = true;
this.Wizard.SelectedPage.CancelButtonVisible = true;
The result didn't change. Both buttons visible, only 'Cancel' button was enabled.
I've actually changed my approach to just use a single 'Cancel' button (this is probably what I should have done anyway), but I thought I'd still bring this to your attention.