Hello,
I am fairly new to C# so forgive me if this is a simple question but I cannot seem to find anything on this subject (I am proabably not searching for the correct thing)
How would you go about setting form control properties such as a succession of many label's text properties dynamically after an event trigger such as a button click?
For an example of a snippit of code I am toying with...
/*
* The array is already filled with 7 random numbers from
* a method called generateRandom()
*
* This code works just fine.
* I am trying to figure out how I can do this
* without having to hard code the labels text output
*/
int[] theArray;
rng.generateRandom(out theArray);
labelNum0.Text = theArray[0].ToString();
labelNum1.Text = theArray[1].ToString();
labelNum2.Text = theArray[2].ToString();
labelNum3.Text = theArray[3].ToString();
labelNum4.Text = theArray[4].ToString();
labelNum5.Text = theArray[5].ToString();
labelNum6.Text = theArray[6].ToString();
Instead of having to hard code the label's output, how would I go about doing it automatically?
Thank you in advance for any insight you can provide!