Results 1 to 3 of 3

Thread: creating textbox/label-arrays

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    3

    creating textbox/label-arrays

    Hi Everyone,

    I'd like to know how to create an array of textboxes or labels at run-time. My goal is to draw circles on a form and place a label or textbox near it to name the circles. And because the amount of circles is unknown (to the program), i'll have to create the same amount of labels. But when i try to declare them, i get runtime error 91: "object variable or with block variable not set"

    My code is as follows:

    dim labelarray(0 to 10) as textbox
    labelarray(0).text="hello"

    This causes the error.

    Can anyone help me please?

    lavschie

  2. #2
    mememee
    Guest

    Wink

    Here is what i would do.


    Create labelarray in your design with index of 0. (which is the beginning of creating a control array)

    Then

    For num = 1 to 12

    Load labelarray(num)
    labelarray(num).caption = "hello"


    'for formatting fun
    labelarray(num).top = labelarray(num - 1) + labelarray(0).height

    labelarray(num).visible = true

    Next num

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    3

    Smile

    I thank you very much!!
    I just didn't know the 'load' statement. I do programming in VB for only a week, so i have to learn a lot.
    This forum is very useful by the way

    lavschie

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