Hi,
Firstly apologies for asking a similar question to one I know has been covered before but I'm quite new to visual basic and dont really understand the answers or how to get the next step. Im looking to dynamically generate a label array with three label 'boxes' per array.
Labelx(0)
Labelx(1)
Labelx(2)
The number of arrays 'x' is given by an integer value. To complicate matters slightly tho the labels are to be created within a frame on a userform. So far I have a basic attempt (very similar to another thread here!) to get even one appearing but its missing an object definition I think (tho I cant seem to find out which I need!).
x=2
For i = 1 To x
'Dim ctlNew As New UF_Inventory_Ma nager.Frame1.La bel !!!!!!
With ctlNew
.Name = "Label" & x & Trim(CStr(i))
.Text = .Name
.Visible = True
.Width = 1335
.Top = 720
.Left = 120
End With
UF_Inventory_Ma nager.Controls. Add (ctlNew)
next
Any help is greatly appreciated.
Firstly apologies for asking a similar question to one I know has been covered before but I'm quite new to visual basic and dont really understand the answers or how to get the next step. Im looking to dynamically generate a label array with three label 'boxes' per array.
Labelx(0)
Labelx(1)
Labelx(2)
The number of arrays 'x' is given by an integer value. To complicate matters slightly tho the labels are to be created within a frame on a userform. So far I have a basic attempt (very similar to another thread here!) to get even one appearing but its missing an object definition I think (tho I cant seem to find out which I need!).
x=2
For i = 1 To x
'Dim ctlNew As New UF_Inventory_Ma nager.Frame1.La bel !!!!!!
With ctlNew
.Name = "Label" & x & Trim(CStr(i))
.Text = .Name
.Visible = True
.Width = 1335
.Top = 720
.Left = 120
End With
UF_Inventory_Ma nager.Controls. Add (ctlNew)
next
Any help is greatly appreciated.
Comment