Right now, when i click a button it will add the username that is on the listbox and add that person. What i am trying to do is make it automatically go down the list and add all of the usernames. To do that I just need to figure out how to correctly loop this code below
Expand|Select|Wrap|Line Numbers
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- WebBrowser1.Navigate("www.teenspot.com/profiles/" & ListBox1.SelectedItem & "/add")
- ListBox1.SelectedIndex = ListBox1.SelectedIndex + 5
- ' This is the "sleep" function.
- ' This makes your webbrowser finish loading before new action.
- Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete And WebBrowser1.IsBusy = False
- Application.DoEvents()
- Loop
- WebBrowser1.Document.GetElementById("confirm").InvokeMember("click")
- Try
- Catch ex As Exception
- ' Generates a messegebox with the error.
- MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
- End Try
- End Sub