private void b_Click(object sender, EventArgs e) { Button b = (Button)sender; string cmd = Z_mXML.ButtonList(Convert.ToInt32(b.Name.Substring(6)), 1); AnswerTB.Text = ""; BarcodeTB.Text = cmd; Send_Receive(cmd); }
private void ButtonBuild() { int j = 0; for (int i = 0; i < Z_mXML.ButtonLength; i++) { if (Z_mXML.ButtonList(i, 0) == Z_mXML.ActionNumber.ToString()) { Button b = new Button(); b.Font = new System.Drawing.Font("Courier New", 10F, System.Drawing.FontStyle.Bold); b.Location = new Point(12 * (j + 1) + 90 * j, 220); b.Name = "Button" + i.ToString(); b.Size = new Size(90, 40); b.Text = Z_mXML.ButtonList(i, 2); b.Click += new EventHandler(b_Click); this.Controls.Add(b); j++; } } }