//edited down to show the point for clarity - this code would be very buggy! protected override void btnNext_Click(object sender, EventArgs e) { if (this.CurrentStep == 1) // Report selection page { if (selectedReport.HasParameterUI) { WizardPages[1] = selectedReport.GetParametersWizPage(this); CurrentStep = 2; ShowCurrentPage(); btnPrevious.Enabled = true; // fix bug in mmWizardForm } } }and for completeness the first page's list selection
private void lstReport_SelectedIndexChanged(object sender, EventArgs e) { // again this code is incomplete for clarity this.WizardForm.btnNext.Enabled = null!=oSelectedReport && oSelectedReport.HasParameterUI; this.WizardForm.btnFinish.Enabled = null!=oSelectedReport && ! oSelectedReport.HasParameterUI; }I don't suggest you rewrite anything just now, but when I wrote a wizardy framework in VFP, I gave each page a convenient way (SetWizardButtonsEnables() to enable or disable next/prev/finish buttons, and the page itself usually decided what the next page was. It wasn't perfect, and I got complaints from other programmers that it was too complicated, but that's probably because I'm the one that wrote the wizards with 20 steps!