Results 1 to 4 of 4

Thread: WebBrowser Control Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80

    Question

    I have a WebBrowser Control on the main form of my app. I plan to bundle an HTML page with the install and have it display in the control.

    That part I have no problem with, but what I would like to do is to check for a valid internet connection and if there is one, to display that page in the WebBrowser control.

    My question is how do I check for the connection and if it's not there, display my bundled HTML page instead of the "Invalid URL" page that the control loads by default.

    Thanks in advance for any help.

  2. #2
    Member
    Join Date
    Jul 2000
    Location
    BFE in Oregon
    Posts
    33
    http://www.mvps.org/vbnet/code/netwo...ectedstate.htm
    And to remove the Invalid page message just include this in the form_load event

    WebBrowserCtl.Navigate "about:blank"

    That will show a blank page and eliminate the Invalid page(address) Then after you check for the net connection you can redirect it to the appropriate page.

    [Edited by Glacius Cool on 09-12-2000 at 05:55 PM]
    Glacius Cool
    Concept Designer
    VB5sp4,VC++6sp3

  3. #3
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    This method works some times:
    Code:
    Label1.Caption = Winsock1.LocalIP
    If Label1.Caption = "" Then
       WebBrowser1.Navigate ("C:\index.html")
    End If
    or

    Registry way
    Just add an IfThen Statment at the end of that code.


    Gl,
    D!m

    Dim

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80

    Talking

    Thanks a lot Glacius and Dim. I will try both of your suggestions.

    Dim:
    Why does the Winsock method only work sometimes?

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