1
Answer

Variable string as Objectname

Ask a question
darealremco

darealremco

20y
2.2k
1
I'm a Dutch student and i'm starting with one of my first c# applications. Today a big problem occured to me: I want to use a string as an object name for a textbox. I'd like to make several textboxes within a for-statement and I want to use names for these, so I can modify them seperately. The problem is that I can't modify them, because they don't have different object names. I'd like to give them names like: textBox1, textBox2, etc. How can I use a string to become an object name? (as in the example, the first time the for-loop runs, I want the object to have the name textBox1, the second loop, textBox2 etc. etc.) thank you very much in advance, Remco van Wijk

Answers (1)