Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change label properties dynamically

Status
Not open for further replies.

pgstein

Programmer
Jul 27, 2005
33
0
0
US
Hi, Is there any way to change label properties dynamically? Basically I have three labels: label1, label2, and label3. What I basically want to do is:

for i = 1 to 3
label & i.visible = true
next i

I know that doesn't work, but is there anyway to do something similar? I am trying to replace an object array that I made in VB6.
Thanks alot,
Paul
 
you can use a for each loop to cycle through all of the controls on a control, then inside the loop check to see if the object is a label control. The code has been posted quite a few times, it may even have a FAQ.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top