public void Bind(TabControl tctrl, CtlWizardOptions opts) { tctrl.FindForm().AcceptButton = _btnNext; tctrl.FindForm().CancelButton = _btnBack; _btnBack.DialogResult = DialogResult.None; // Annoyingly CancelButton sets this this.Pager = new PagerControl(ref tctrl, this.panel1); this.Pager.PageChanged += this.pc_PageChanged; this.pc_PageChanged(this.Pager, EventArgs.Empty); this.Options = opts; }
public static CtlWizard BindNew(Control form, TabControl tctrl, CtlWizardOptions opts) { CtlWizard ctl = new CtlWizard(); form.Controls.Add(ctl); ctl.Margin = Padding.Empty; ctl.Dock = DockStyle.Fill; ctl.Visible = true; ctl.Bind(tctrl, opts); return(ctl); }