private void InitOKButton() { Button btnOK = new CUButton(); btnOK.Text = "OK"; btnOK.Click += ButtonClick; this._buttonCollection.Add(btnOK); }
public void Init() { this.Controls.Clear(); if (ParentTabControl == null) { return; } var list = new List <CUButton>(); int i = 0; foreach (var p in ParentTabControl.TabPages) { var page = (TabPage)p; var btn = new CUButton { Text = page.Text, Tag = new IndexPage() { Index = i, Page = page, Enabled = true }, Dock = DockStyle.Fill, Margin = new Padding(0, 0, 0, 1), ImageAlign = ContentAlignment.TopCenter, TextImageRelation = TextImageRelation.ImageAboveText }; btn.FlatAppearance.BorderSize = 0; if (ParentTabControl.ImageList != null) { btn.ImageList = ParentTabControl.ImageList; btn.ImageIndex = page.ImageIndex; } list.Add(btn); i++; } TableLayoutPanel panel = new TableLayoutPanel(); panel.RowStyles.Clear(); for (i = 0; i != list.Count(); i++) { panel.RowStyles.Add(new RowStyle() { SizeType = SizeType.Percent, Height = 100 / list.Count() }); panel.Controls.Add(list[i], 0, i); list[i].Click += TabController_Click; } panel.Dock = DockStyle.Fill; panel.Location = new Point(0, 0); this.Controls.Add(panel); UpdateButtonStates(); }
private void InitYesNoButtons() { Button btnYes = new CUButton(); btnYes.Text = "YES"; btnYes.Click += ButtonClick; Button btnNo = new CUButton(); btnNo.Text = "NO"; btnNo.Click += ButtonClick; this._buttonCollection.Add(btnYes); this._buttonCollection.Add(btnNo); }
private void InitRetryCancelButtons() { Button btnRetry = new CUButton(); btnRetry.Text = "OK"; btnRetry.Click += ButtonClick; Button btnCancel = new CUButton(); btnCancel.Text = "CANCEL"; btnCancel.Click += ButtonClick; this._buttonCollection.Add(btnRetry); this._buttonCollection.Add(btnCancel); }
private void InitOKCancelButtons() { Button btnOK = new CUButton(); btnOK.Text = "OK"; btnOK.Click += ButtonClick; Button btnCancel = new CUButton(); btnCancel.Text = "CANCEL"; btnCancel.Click += ButtonClick; this._buttonCollection.Add(btnOK); this._buttonCollection.Add(btnCancel); }
private void InitAbortRetryIgnoreButtons() { Button btnAbort = new CUButton(); btnAbort.Text = "INTERRUPT"; btnAbort.Click += ButtonClick; Button btnRetry = new CUButton(); btnRetry.Text = "RETRY"; btnRetry.Click += ButtonClick; Button btnIgnore = new CUButton(); btnIgnore.Text = "IGNORE"; btnIgnore.Click += ButtonClick; this._buttonCollection.Add(btnAbort); this._buttonCollection.Add(btnRetry); this._buttonCollection.Add(btnIgnore); }