In visual c#, I have built a win form in which I have 10 buttons
I have the following code for button10_Click(object sender, EventArgs e):
button1.Text = "A".toString();
button2.Text = "B".toString();
button3.Text = "C".toString();
...
button9.Text = "I".toString();
But the code is too lengthy. Is there any way I can do this inside a loop? Something like this:
char x = 'A';
for(int i = 1; i<10;i++,x++)
{
button[i].Text = x.toString();
}
Pls help
string. No need to addToStringto it . ;-)