1
I created two Labels dynamically based on a vector according to the code below, however, in the form only remains the last Label created (Newlabel1), both the first (Newlabel0) and the Label I used as the basis for creating the other two (Label1) do not remain.
I need to create several Labels according to the number of items I want to work on (one for each product of a certain cosmetics line, for example), so the need to use a vector. How can I fix this?
Dim NewLabel(1) As Object
Set NewLabel(0) = Label1 'Label1 existe no formulário
Set NewLabel(1) = Label1
With NewLabel(0)
.Caption = "NewLabel0"
.Top = 0
.Left = 0
End With
With NewLabel(1)
.Caption = "NewLabel1"
.Top = 20
.Left = 20
End With
...
...
...
NewLabel(0).Delete
NewLabel(1).Delete