Well, listview is quite different from ordinary listbox...
Anyway, try this sample:
VB Code:
Option Explicit Private Sub Form_Load() With List1 .AddItem "Item 1" .AddItem "Item 2" .AddItem "Item 3" .AddItem "Item 4" .AddItem "Item 5" End With End Sub Private Sub Command1_Click() Dim iIndex%, sItem$, i% Randomize With List1 For i = 0 To .ListCount - 1 iIndex = Int((.ListCount * Rnd) + 1) sItem = .List((iIndex - 1)) .RemoveItem (iIndex - 1) .AddItem sItem Next i End With End Sub




Reply With Quote