0

I have 18 text boxes named 'txtmybox' with indexes set as 0 to 17.

To change the back color I currently use a for..next loop ie:

for x = 0 to 17
txtmybox(x).backcolor=red
next x


The question is - is there a quicker way to perform this task, ie change all boxes in one go?


thanks

3
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by skyshare
0

As ChrisPadgham said..that is a simplest way.
This following is other way (But Still needed to use Looping):

For Each controlx In Form1.Controls
    If TypeOf controlx Is TextBox Then controlx.BackColor = vbRed
Next controlx
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.