Whats the command to make a new object.
I have a line named BorderLine(0) and
I want to make like 100 with a loop
and I want them to have the same name,
How do I do that at runtime.
Thanks.
Printable View
Whats the command to make a new object.
I have a line named BorderLine(0) and
I want to make like 100 with a loop
and I want them to have the same name,
How do I do that at runtime.
Thanks.
Code:For I = 1 To 100
Load BorderLine(I)
With BorderLine(I)
.X1 = I
.X2 = I * 20
.Y1 = I * 3
.Y2 = I * 40
.Visible = True
End With
Next I
Make BorderLine with an index of 0
Code:Private Sub Command1_Click()
'something to play with.
Dim intcre As Integer
Do Until intcre = 100
intcre = intcre + 1
Load BorderLine(intcre)
BorderLine(intcre).X1 = BorderLine(intcre - 1).X1 + 50
BorderLine(intcre).Y1 = BorderLine(intcre - 1).Y1 + 50
BorderLine(intcre).Visible = True
Loop
End Sub