private void btnBack_Click(object sender, EventArgs e) { WizardPage.PageTransitionEventArgs args = new WizardPage.PageTransitionEventArgs(); pages[activePage].OnPageBack(args); if (!args.Cancel) { ActivatePage((int)(activePage - args.PageCount)); } }
private void btnNext_Click(object sender, EventArgs e) { WizardPage.PageTransitionEventArgs args = new WizardPage.PageTransitionEventArgs(); pages[activePage].OnPageNext(args); if (!args.Cancel) { // the "Next >" button will become the "Finish" button on the last page if ((activePage + 1) < pages.Length) { // activate the next page ActivatePage((int)(activePage + args.PageCount)); } else { // the "Finish" button has been pressed, close the wizard Close(); } } }