-
Hi,
How can I initialize a lot of TextBox like below:
TextBox1.Text = "0"
TextBox2.Text = "0"
TextBox3.Text = "0"
TextBox4.Text = "0"
TextBox5.Text = "0"
TextBox6.Text = "0"
TextBox7.Text = "0"
TextBox8.Text = "0"
...
...
TextBox99.Text = "0"
TextBox100.Text = "0"
Is there a more intelligent way to do this, instead of repeating the same code a lot of times?
Thanks for any idea...
Michel Jr.
-
You could make an array of textboxes, just name them the same and set a individual index to each:
Code:
Dim a As TextBox
For Each a In Text1
a = 0
Next a
-
If your problem is solely on Text Boxes, you should use a control array. When creating your textboxes, you create one, copy and paste it... VB will create the array for you.
Then, you can scroll through it just as Text1(i).Text = "0"