Hi,
this modified code of yours should work:
private Button[] bu = new Button[12];
public static int index1;
public int[] ar = new int[4];
public string[] cl1 = new string[4];
index1 = 0;
{
x = 30;
for (int i = 0; i < ar.Length; i++)
{
bu[index1] = new Button();
bu[index1].Location = new Point(50, x);
bu[index1].Size = new Size(75, 20);
bu[index1].Text = "1";
bu[index1].Click += new EventHandler(button_Click);
cl1[i] = "b" + i;
lable[index1] = new Label();
lable[index1].Location = new Point(75,(x+25));
lable[index1].Size = new Size(35, 13);
bu[index1].Name = Convert.ToString(cl1[i]);
lable[index1].Text = bu[index1].Name;
x = x + 100;
index1++;
}
this.Controls.AddRange(bu);
this.Controls.AddRange(lable);
}
private void button_Click(object sender, EventArgs e)
{
MessageBox.Show("You hv cast ur vote for the 1ft preference");
}