void myButton_Click(object sender, EventArgs e) { panelEditButton.Visible = true; panelEditButton.BringToFront(); txtTableName.Text = ((MyButton) sender).Text_pro; selectedButton = (MyButton) sender; ((MyButton) sender).BringToFront(); }
protected override void OnClick(EventArgs e) { base.OnClick(e); this.Focus(); panelEditSection.Visible = true; panelEditSection.BringToFront(); selectedButton = null; }
public void addButton(MyButton a) { a.Click += new EventHandler(myButton_Click); this.Controls.Add(a); mangMyButton.Add(a); }
public ArrayList getTablesEdit(string storeID, string sectionName) { ArrayList mangButton = new ArrayList(); DataTable tbl = getGui.GetAllTablesBySectionID(storeID, sectionName); for (int i = 0; i < tbl.Rows.Count; i++) { if ((int)tbl.Rows[i][10] == 0) { int x = (int)tbl.Rows[i][4]; int y = (int)tbl.Rows[i][5]; int height = (int)tbl.Rows[i][6]; int width = (int)tbl.Rows[i][7]; MyButton.ButtonStyles style; if((int)tbl.Rows[i][3] == 0 || (int)tbl.Rows[i][3] == 1 ) { style = MyButton.ButtonStyles.Rectangle; } else { style = MyButton.ButtonStyles.Ellipse; } var tmpBut = new MyButton(x, y, width, height, style); tmpBut.borColor = Color.FromArgb((int) tbl.Rows[i][13]); tmpBut.Text_pro = tbl.Rows[i][2].ToString(); mangButton.Add(tmpBut); } } return mangButton; }
private void button13_Click(object sender, EventArgs e) { var a = new FrmKeyBoard(); if (a.ShowDialog() == DialogResult.OK) { var tmp = (panel)listPanel[sections[selectedSection - 1]]; var tmpBut = new MyButton(100, 100, 100, 100, MyButton.ButtonStyles.Rectangle); tmpBut.Text_pro = a.value; tmpBut.isNew = true; tmp.addButton(tmpBut); } }
private void button15_Click(object sender, EventArgs e) { var a = new Form2(); if (a.ShowDialog() == DialogResult.OK) { var tmp = (panel)listPanel[sections[selectedSection - 1]]; var tmpBut = new MyButton(100, 100, 100, 100, MyButton.ButtonStyles.Ellipse); tmpBut.Text_pro = a.text; tmpBut.isNew = true; tmp.addButton(tmpBut); } }