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????? :ehh:
Printable View
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????? :ehh:
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.
You might want to allow VB6 to access the web in your firewall settings.
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 :-)
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??????
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.VB Code:
Private Sub Form_Load() WebBrowser1.Navigate ("c:\Welcome.html") End Sub
The problem with that being, Internet Explorer would also not show this page..Quote:
Originally Posted by gavio
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.
No it isn't. It resides inside a dll in the system32 folder..Quote:
Originally Posted by smUX
chem
Thanks everyone!!!
I just made my WebBrowser open a file in the end.
That way it doesn'y mess up IE...