I want to create 10 buttons on my form when I click on button1. No error with this code below but it doesnt work either.
private void button1_Click(object se
It doesn't work because the list is empty. Try this:
private void button1_Click(object sender, EventArgs e) { List buttons = new List(); for (int i = 0; i < 10; i++) { Button newButton = new Button(); buttons.Add(newButton); this.Controls.Add(newButton); } }