|
-
Aug 6th, 2003, 10:46 PM
#1
Thread Starter
New Member
Use loops to generate labelboxes
I'm trying to use a loop to create label boxes and then populate them with information. At the moment I need about 100 label boxes, and that's far too much to graphically create. I'm pretty sure that I've seen someone use a loop to create components before. Here's the logic I've come up with
----------------------
code
---------------------
for counter = 0 to array.getupperbound(0)
<create label box at X + (20 * counter) pixels down and Y pixels right>
label (according to the counter).text = array(counter).toString
next
---------------------------------
Thanks for any help. Hope I wasn't too vague as I'm dead tired right now
-
Aug 7th, 2003, 03:56 AM
#2
Lively Member
you can easily do this :
VB Code:
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label Then
ctype(ctl,label).Text = "hello"
End If
Next
HTH
-
Aug 7th, 2003, 07:09 AM
#3
Thread Starter
New Member
Thanks, I'll have to work on this when I get home from work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|