-
i need to have the list box go to the next item every 20 milliseconds. listindex is too slow and sendkeys works but not good for what i am making ( a program which records mouse movements then plays it back on a contious loop)
so is there a way which i can make the list go down even though the form is not in focus>?
-
Use GetTickCount as a Timer.
Code:
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Command1_Click()
Dim Start As Long
Do Until List1.ListIndex = 10
Start = GetTickCount
Do While GetTickCount < Start + 20
DoEvents
Loop
List1.ListIndex = List1.ListIndex + 1
Loop
End Sub
Private Sub Form_Load()
'Populate ListBox
For i = 0 To 10
List1.AddItem i
Next i
End Sub
-
k. thnx. i found out why i was so slow. it had to scroll through the listbox