|
-
Sep 14th, 2001, 01:37 PM
#1
Thread Starter
New Member
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
-
Sep 14th, 2001, 02:18 PM
#2
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
-
Sep 14th, 2001, 03:08 PM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|