private void button1_Click(object sender, EventArgs e) { batch b = new batch(); this.Hide(); b.Show(); }
public void viewbatch() { byte batchCount = 0; int count = 0; Label[] batchNames = new Label[100]; int labelX = 200, labelY = 200; conn.Open(); try { //to add labels on click submit cmd = new SqlCommand("Select * from control", conn); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ss[count] = dr["controlName"].ToString(); batchNames[batchCount] = new Label(); batchNames[batchCount].Name = "batchName" + batchCount; batchNames[batchCount].Location = new Point(labelX, labelY); batchNames[batchCount].Font = new Font("Microsoft Sans Serif normal", 12.75F); batchNames[batchCount].Text = dr["controlName"].ToString(); f1.bunifuGradientPanel7.Controls.Add(batchNames[batchCount]); batchNames[batchCount].Click += (object s, EventArgs ev) => { batch b = new batch(); b.Show(); }; labelY += 20; batchCount++; count++; } } catch (Exception e) { MessageBox.Show(e.ToString()); } conn.Close(); }
public supportingClass(Form1 ff, batch bb) { f1 = ff; b1 = bb; }