dcsimg
Results 1 to 5 of 5

Thread: Dimming a webbrowser?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2009
    Posts
    435

    Dimming a webbrowser?

    Code:
     Dim wb As New WebBrowser
            wb.Navigate("http://google.com")
    MsgBox(wb.Url.ToString)
    Code:
    WebBrowser1.Navigate("http://google.com")
    MsgBox(WebBrowser1.Url.ToString)
    How come the first one does not work? (The message shown is blank)

  2. #2
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: Dimming a webbrowser?

    try this:
    Code:
     Dim wb As New WebBrowser
            Me.Controls.Add(wb)
            wb.Navigate("http://google.com")
            While (Not wb.ReadyState = WebBrowserReadyState.Complete)
                Application.DoEvents()
                If (wb.ReadyState = WebBrowserReadyState.Complete) Then
                    MessageBox.Show(wb.Url.ToString)
                End If
            End While
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2009
    Posts
    435

    Re: Dimming a webbrowser?

    Quote Originally Posted by motil View Post
    try this:
    Code:
     Dim wb As New WebBrowser
            Me.Controls.Add(wb)
            wb.Navigate("http://google.com")
            While (Not wb.ReadyState = WebBrowserReadyState.Complete)
                Application.DoEvents()
                If (wb.ReadyState = WebBrowserReadyState.Complete) Then
                    MessageBox.Show(wb.Url.ToString)
                End If
            End While
    Is it possible to do without showing the webbrowser?

  4. #4
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: Dimming a webbrowser?

    yep just don't add it to the form (remove Me.Controls.Add(wb))
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

  5. #5
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    519

    Re: Dimming a webbrowser?

    If you want to download information from the internet without showing anything visually, you might want to consider using a WebClient object instead.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width