Referencing Multiple Object in single statement

jay_hl

New member
Joined
Feb 27, 2010
Messages
3
Programming Experience
1-3
Hi All

I have a question over whether it is possible to reference multiple objects (textboxes) in a single statement using maybe a wildcard.

I have to make visible approx 300 text boxes based on a trackbar value, and wondered rather than:
tbxW2R1.visible = true
tbxW2R2.visible = true
tbxW2R3.visible = true etc.

I could do something like:
tbxW2R & "*" .visible = true

I have to say that only some will hide in stages, so I cant really use a "set all textbox types on the form to hide" statement.

Anyone any ideas?

Thanks
 
Last edited:
Put them on a panel and loop through?
Do a check to see if the control is one you want visible and then make visible.

not tested the below code, just written it onto here:

for each c as control on panel1
if c.getype.name = "ControlType_CHange to relevant control type" then
c.visible = true
End IF
next
 
Back
Top