public void GoToStep(IWizardStep step) { if (step is Controls.Welcome) { _history.Clear(); } var ctrl = step as Control; if (ctrl == null) { throw new ArgumentException("Each step must be a control."); } var curr = tblMain.GetControlFromPosition(1, 3); if (curr != null) { tblMain.Controls.Remove(curr); } ctrl.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; tblMain.Controls.Add(ctrl, 1, 3); this.Message = ""; this.NextLabel = "&Next"; step.Configure(this); btnPrevious.Enabled = _history.Any(); _history.Push(step); }
public void GoToStep(IWizardStep step) { if (step is Controls.Welcome) _history.Clear(); var ctrl = step as Control; if (ctrl == null) throw new ArgumentException("Each step must be a control."); var curr = tblMain.GetControlFromPosition(1, 3); if (curr != null) tblMain.Controls.Remove(curr); ctrl.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; tblMain.Controls.Add(ctrl, 1, 3); this.Message = ""; this.NextLabel = "&Next"; step.Configure(this); btnPrevious.Enabled = _history.Any(); _history.Push(step); }