Results 1 to 3 of 3

Thread: Goto next item in listbox. This is easy....maybe

  1. #1

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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>?
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    k. thnx. i found out why i was so slow. it had to scroll through the listbox
    Remember, if someone's post was not helpful, you can always rate their post negatively .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width