samedi 20 novembre 2021

c# Loop 10000 textboxes without writing their name

Example:
I have 1000 textboxes in 1 form. The textboxes names are textbox1, textbox2 ... textbox1000 I want to be able to do the following thing:

String myString = "textbox";
for (int i = 0; i <= 1000; i = i + 1) 
myString + i.Text = "Textbox number " + i.ToString() 
next

IMPORTANT, solve my goal not my example

My goal is to not write the textbox, and get it from a predefined string, well, like the example

Sorry for the confusion and the edits. Its my first post :/

example 2, goal is the same





Aucun commentaire:

Enregistrer un commentaire