I need to build control sets of custom controls programatically as I need more than 200 of each control.
I used a method suggested by Jeff Tullin on this forum in 2019 but it doesn’t seem to work with custom controls.
First I built a custom class based on a rectangle control and called aBoxClass, then I created a control set with one example aBox(0) on my window. Finally I added a method:
Dim aBox() As aBoxClass
for x as integer = 1 to 10
aBox(x)= new aBoxClass
aBox(x).left = 30
aBox(x).top = 20 + 20 * x
aBox(x).visible = true
next
This is a copy of Jeff’s method using my custom class instead of a built-in class.When I run it, I get a syntax error at the first Dim line.
Can anyone tell me what I am doing wrong here?