Results 1 to 3 of 3

Thread: Use loops to generate labelboxes

  1. #1

    Thread Starter
    New Member Mr_Munkey's Avatar
    Join Date
    May 2003
    Posts
    8

    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

  2. #2
    Lively Member
    Join Date
    Sep 2002
    Location
    Belgium
    Posts
    99
    you can easily do this :

    VB Code:
    1. Dim ctl As Control
    2.         For Each ctl In Me.Controls
    3.             If TypeOf ctl Is Label Then
    4.                 ctype(ctl,label).Text = "hello"
    5.             End If
    6.         Next

    HTH

  3. #3

    Thread Starter
    New Member Mr_Munkey's Avatar
    Join Date
    May 2003
    Posts
    8
    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
  •  



Click Here to Expand Forum to Full Width