private void OnFormShown(object sender, EventArgs e) { WizardPageBase firstPage = this.SelectedPage; if (firstPage != null) { firstPage.OnBeforeDisplay(EventArgs.Empty); firstPage.OnAfterDisplay(EventArgs.Empty); } }
public virtual void GoNext() { //thread safe call if (this.InvokeRequired) { VoidCallback callback = new VoidCallback(GoNext); this.Invoke(callback); } else { if (this.SelectedPage != null) { this.disabled = true; this.RedrawButtons(); this.Cursor = Cursors.WaitCursor; try { WizardPageBase selectedPage = this.SelectedPage; CancelEventArgs args = new CancelEventArgs(); selectedPage.OnBeforeMoveNext(args); if (!args.Cancel) { if (selectedPage.NextPage == null) { this.OnFinish(EventArgs.Empty); } else { WizardPageBase nextPage = selectedPage.NextPage; if (nextPage != null) { nextPage.OnBeforeDisplay(EventArgs.Empty); } this.SelectedPage = nextPage; if (nextPage != null) { nextPage.OnAfterDisplay(EventArgs.Empty); } } } } finally { this.disabled = false; this.RedrawButtons(); this.Cursor = Cursors.Default; } } } }