private void ShowSeat()
{
Label lbl = new Label();
for (int i = 0; i < seatRow; i++)
{
for (int j = 0; j < seatCol; j++)
{
lbl.Name = "lbl" + (i+1) + "-" +( j+1);
lbl.Click += new EventHandler(lbl_Click);
lbl.BackColor = Color.Yellow;
lbl.AutoSize = false;
lbl.Location = new System.Drawing.Point(59, 60);
lbl.Size = new System.Drawing.Size(50, 25);
lbl.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular,System.Drawing.GraphicsUnit.Point,((byte)(134)));
lbl.Text = lbl.Name = "lbl" + (i + 1) + "-" + (j + 1);
lbl.Location = new System.Drawing.Point(60 + (i * 90), 60 + (j * 60));
this.tpSeatList.Controls.Add(lbl);
}
原理差不多,不过你要获取那个Button事件
}
}