Click to See Complete Forum and Search --> : Create New Listobox at Run-Time


Martin Evans
September 25th, 2001, 08:53 AM
I know how to create New Forms using the "NEW" method. How can this be done to create ne List boxes??

DSJ
September 25th, 2001, 02:42 PM
You have to have one listbox already on the form (although it doesn't have to be visible). Set it's Index property to 0. Then in your code:



load listboxname(1)
load listboxname(2)
load listboxname(3)

'etc. until you have as many as you need

urs
September 25th, 2001, 02:48 PM
Private Sub Command1_Click()
Dim lst As ListBox
Set lst = Controls.Add("vb.listbox", "lst")
lst.Visible = True
End Sub
then u can set its left,right,etc...