Question Problem With WebBrowser

Ehsansh

New member
Joined
Feb 20, 2009
Messages
4
Programming Experience
5-10
Hi there.
After this lines of code when I check W.Document I see that was Nothing!
Why?
Dim W As New WebBrowser
Me.Controls.Add(W)
W.Navigate("http://www.google.com")
Threading.Thread.Sleep(10000)
 
Thread.Sleep means you stop your application thread for that time.
 
This gets me to Google with no problem.

VB.NET:
    WithEvents wb As New WebBrowser

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Controls.Add(wb)
        wb.Dock = DockStyle.Fill
        wb.Navigate(New Uri("http://www.google.com"))
    End Sub

    Private Sub wb_Navigated(ByVal sender As Object, ByVal e As WebBrowserNavigatedEventArgs) Handles wb.Navigated
        Me.Text = wb.Url.ToString()
    End Sub
 
Thanx for your care but the main problem is:
I wanna to load a web page in memory and get data from.
I don't wanna to show user anything.

because I have many procedure to do with web browser I prefer to not putting the code inside navigated or document completed procedures.

can you solve my problem?
 
Back
Top