
Setting Multi-Select prop on ListBox
One way is to place one on your form at design time and set it's visible
property = False until you need it. Or.. if you'll need more than one, you
can place one on the form, visible = False, set its properties the way you
want and its Index property = 0, then use Load to load more. They'll
"inherit" most of their parents properties.. Not sure how much you know
about this stuff so here's an example (modified from a reply to a similar
question)
If lstHidden is an existing Listbox, just set it's Index property = 0 which
creates an array. Then use something like...
'===============
Private Sub cmdAddAnother_Click()
Dim iNewOne As Integer
iNewOne = lstHidden .UBound + 1
Load lstHidden (iNewOne)
With lstHidden (iNewOne)
.Move WhereEver
.Visible = True
End With
End Sub
Private Sub lstHidden _Click(Index As Integer)
'Note that each event handler now has
'Index As Integer to let you know
'which control raised the event
End Sub
'===============
Also note that if you already have code in some of the event handlers,
you'll need to add that "Index As Integer" param to those subs
Quote:
> I am creating a ListBox via the Controls.Add method versus at design time.
> This prevents the ability to set the Multi-Select property of the ListBox.
> I'm guessing this property can still be set using the API however. Does
> anyone know how?
> Thanks in advance!
> JR