Use the Random Number to set the Listboxes ListIndex Property, eg.
------------------Code:Private Sub Command1_Click() Randomize Timer List1.ListIndex = Int(Rnd * 19) End Sub Private Sub Form_Load() Dim iIndex As Integer For iIndex = 1 To 20 List1.AddItem "Item " & iIndex Next End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]




Reply With Quote