S
Scott Gravenhorst
I recently (within 30 days) downloaded and installed VB 2005 Express.
I like it a whole lot... but:
I have been trying to work with the WebBrowser control to display a
small amount of help text for my application and though I've finally
made it work, it seems a bit quirky, so perhaps that's the control
being quirky or perhaps there is something I don't understand.
1) I could not figure out a way to make the webbrowser object display
a page of HTML from a file on the local disk in the same directory as
the application. I tried setting the Url property to file:///help.htm
and file://help.htm and neither worked. help.htm was in the
applications directory. -- Is that were it should exist? I would
prefer to use the control with a local file, but read on...
2) I then found that I could stuff text into the
WebBrowser.DocumentText property and alas - the page was displayed
(that is, the page of text that I stuffed into the property, not the
page as described by the Url property).
3) I cleaned up the object by removing the text in the Url property -
this broke it and the WebBrowser object displayed nothing, even though
I stuffed the DocumentText property.
4) I tried setting the Url property to about:blank, still the object
displayed nothing.
5) Then I found that as long as there is something like http://x in
the Url propertly, the webbrowserobject will display the HTML I stuff
into the DocumentText property. This is true, even if the page
referred to by the Url property does not exist. -- so why doesn't
using about:blank work?
Also, the AllowNavigation property must be set to true or this won't
work.
I've looked on various web forums and while I can see that others have
had a similar problem, I haven't seen any solution that makes sense or
simply declares the current object is buggy.
Help/advice/condolences greatly appreciated.
I like it a whole lot... but:
I have been trying to work with the WebBrowser control to display a
small amount of help text for my application and though I've finally
made it work, it seems a bit quirky, so perhaps that's the control
being quirky or perhaps there is something I don't understand.
1) I could not figure out a way to make the webbrowser object display
a page of HTML from a file on the local disk in the same directory as
the application. I tried setting the Url property to file:///help.htm
and file://help.htm and neither worked. help.htm was in the
applications directory. -- Is that were it should exist? I would
prefer to use the control with a local file, but read on...
2) I then found that I could stuff text into the
WebBrowser.DocumentText property and alas - the page was displayed
(that is, the page of text that I stuffed into the property, not the
page as described by the Url property).
3) I cleaned up the object by removing the text in the Url property -
this broke it and the WebBrowser object displayed nothing, even though
I stuffed the DocumentText property.
4) I tried setting the Url property to about:blank, still the object
displayed nothing.
5) Then I found that as long as there is something like http://x in
the Url propertly, the webbrowserobject will display the HTML I stuff
into the DocumentText property. This is true, even if the page
referred to by the Url property does not exist. -- so why doesn't
using about:blank work?
Also, the AllowNavigation property must be set to true or this won't
work.
I've looked on various web forums and while I can see that others have
had a similar problem, I haven't seen any solution that makes sense or
simply declares the current object is buggy.
Help/advice/condolences greatly appreciated.