There is a Controls collection that is automatically created & updated that contains all the controls on a form (or other container controls such as frames).
I'd be surprised if it doesn't work with names, eg:
Form1.Controls("Combo1").text
or:
Frame1.Controls("Combo1").text
You should also consider using normal control arrays, just create one combo with all the properties you want, set visible to false, and set the index to 0. Then you can add more by number, eg:
(assumes first control is named cboControlArray, with an index of 0)
VB Code:
Load cboControlArray(1) cboControlArray(1).Left = ... cboControlArray(1).Top = ... cboControlArray(1).Visible = True Dim i as Integer For i = 2 to 10 Load cboControlArray(i) With cboControlArray(i) .Left = 300 .Top = .Height * i .Visible = True End With Next i




Reply With Quote