Results 1 to 2 of 2

Thread: Do loops

  1. #1

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219

    Do loops

    I am trying to do something with the items on a list box. Everything works fine in this code but i want to loop it till there are no items lest in the listbox. Timer1 does some events that i did not show here but it does not apply to this question. So my 2 qustions are:
    1. How do i loop the loop until there are no items left in the listbox
    2. How make the loop only intiate evry 2 seconds because the webroswer needs time to load. Thanks


    VB Code:
    1. Do
    2.             For Each names In lboPlayers.Items
    3.             Next
    4.             url2 = "http://www.outwar.com/managecrew.php?playername=" & names & "&submit=Invite"
    5.             wbweb2.Navigate(url2)
    6.             Timer1.Enabled = True
    7.         Loop Until  ????????
    -Rob

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    looping through the listbox

    VB Code:
    1. '1.1 Code
    2. 'where obj is the object u stored in, if string then use as string
    3. for each obj as object in listbox1.items
    4.    MessageBox.show(obj.toString())
    5. next
    6.  
    7. '1.o Code
    8. 'where obj is the object u stored in, if string then use as string
    9. dim obj as object
    10. for each obj in listbox1.items
    11.    MessageBox.show(obj.toString())
    12. next

    put this code in a timer that has a interval of 2000 milliseconds
    and ur set

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