st0ne2thedge
Gebruiker
- Lid geworden
- 26 nov 2008
- Berichten
- 43
ik probeer van een webpagina gegevens op te halen maar ik heb nog een klein probleem als ik het in 1 procedure probeer te steken. Ik vind namelijk geen goede methode om te wachten tot het document geladen is...
De code die ik tot nu toe heb is;
De code die ik tot nu toe heb is;
Code:
Dim namenLijst As New List(Of String)
Private Sub btnToonLijst_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles btnToonLijst.Click
namenLijst.Clear()
web.Navigate(TextBox1.Text)
Dim positie As New Point(btnToonLijst.Location.X + btnToonLijst.Width, _
btnToonLijst.Location.Y)
Dim inhoud As String = ""
Dim woord As String = ""
inhoud = web.Document.Body.InnerText
web.Dispose()
For Each letter As Char In inhoud.ToCharArray
If letter = ChrW(Keys.Enter) Then
namenLijst.Add(woord)
woord = ""
Else
If Not Asc(letter) = 10 Then
woord = woord & letter
End If
End If
Next
With cmsNamenlijst.Items
.Clear()
For posInNamen As Integer = 0 To namenLijst.Count - 1
cmsNamenlijst.Items.Add(namenLijst(posInNamen))
Next
End With
cmsNamenlijst.Show(Me, positie)
End Sub