Hi
I am trying to create buttons at runtime. My Question is that How should I add an Event to each of the buttons at runtime mode also?
For example:
Button btn;
int i =0;
int j =0;
List<Button> listBTN = new List<Button>();
private void button1_Click(object sender, EventArgs e)
{
btn = new Button();
btn.Location = new Point(60 + i, 90);
btn.Size = new Size(50, 50);
btn.Name = "BTN";
listBTN.Add(btn);
i = i + 50;
foreach(Button b in listBTN){
this.Controls.AddRange(new Button[] {b});
}
}