Results 1 to 8 of 8

Thread: [Resolved]WebBrowser

  1. #1

    Thread Starter
    Hyperactive Member LawnNinja's Avatar
    Join Date
    Aug 2006
    Posts
    446

    [Resolved]WebBrowser

    I have a WebBrowser Component in my Form but I want it to never say "This Page Cannot be Displayed...........
    Is there a wat to make it say a text you want?????
    Last edited by LawnNinja; Aug 25th, 2006 at 06:12 PM.

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Location
    Ventura County, CA
    Posts
    16

    Re: WebBrowser

    You could either make it go to a html page you upload somewhere when the form loads, you could make it navigate to the user selected home page (set in internet options), or you could make it navigate to a html page that is kept in the same folder of the program when the form loads.

  3. #3
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: WebBrowser

    You might want to allow VB6 to access the web in your firewall settings.

  4. #4
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: WebBrowser

    The "This page cannot be displayed" is a server-side page so it isn't as simple as that. You could check the URL of the page on documentcomplete() to see if it matches a 404 error page, or you could check the source of each page for "This page cannot be displayed"...just options :-)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  5. #5

    Thread Starter
    Hyperactive Member LawnNinja's Avatar
    Join Date
    Aug 2006
    Posts
    446

    Re: WebBrowser

    Ok, I have a html file called Welcome.html in my HardDrive how do you get the WebBrowser to open it right from the beggining??????

  6. #6
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: WebBrowser

    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate ("c:\Welcome.html")
    3. End Sub
    I have made a little research about "This page cannot be displayed". You have to change the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs\NavigationFailure" registry key. Here's a sample.
    Attached Files Attached Files

  7. #7
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: WebBrowser

    Quote Originally Posted by gavio
    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate ("c:\Welcome.html")
    3. End Sub
    I have made a little research about "This page cannot be displayed". You have to change the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs\NavigationFailure" registry key. Here's a sample.
    The problem with that being, Internet Explorer would also not show this page..

    Perhaps you should reset it back to its original setting when closing your program? Or even better, checking the source of the page on an off-screen Webbrowser control. If it contains "Page cannot be displayed", then don't show it in the main WebBrowser. If it doesn't, then show it in the main browser.
    Quote Originally Posted by smUX
    The "This page cannot be displayed" is a server-side page so it isn't as simple as that. You could check the URL of the page on documentcomplete() to see if it matches a 404 error page, or you could check the source of each page for "This page cannot be displayed"...just options :-)
    No it isn't. It resides inside a dll in the system32 folder..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  8. #8

    Thread Starter
    Hyperactive Member LawnNinja's Avatar
    Join Date
    Aug 2006
    Posts
    446

    Re: WebBrowser

    Thanks everyone!!!
    I just made my WebBrowser open a file in the end.
    That way it doesn'y mess up IE...

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