I am using Visual Studio C++ 2010 Express, and i was wondering if its possible to refer to some box (textbox, picture box, whateverbox) using a word/number stored in variable. For example:
textBox1 -> Text = "I fill textBox1 with some text";
same as
string ^ name = "textBox";
int number = 1;
name+number -> Text = "I fill textBox1 with some text";
So, can i achieve that somehow? I am asking cuz i have multiple boxes i would like to change in a loop (for or while) increasing number variable and i dont want to write every box name everytime, that looks awfull in code, and probably isnt the best idea to do that :/
If you have multiple textboxes you are better of storing them in an array of some kind so that you can refer to them as
textbox[0],textbox[1]etc etcor do them in a loop like