[Gambas-user] HtmlView.Url not working

Benoît Minisini g4mba5 at gmail.com
Wed May 11 14:03:47 CEST 2022


Le 11/05/2022 à 06:28, Safiur Rahman a écrit :
> Hi
> 
> When I use URL for HtmlView (gb.for.htmlview)
> HtmlView1.Url = "http://gambas.sourceforge.net/en/main.html 
> <http://gambas.sourceforge.net/en/main.html>"
> it is not showing any content.
> 
> However when I user URL for webview
> WebView1.Url = "http://gambas.sourceforge.net/en/main.html 
> <http://gambas.sourceforge.net/en/main.html>"
> it works and shows content.
> 
> How to supply a URL to htmlView? There is no documentation yet.
> 
> -- 
> Regards
> Safiur Rahman
> 

Yes, sorry, the HtmlView is not documented yet.

As its name says, it's not a browser, it's "just" a control that 
displays HTML.

There is an URL property, so that you can handle URLs, but the control 
will not download it for you.

If the URL is a file path, the HTML will be loaded from it. Otherwise, a 
"Link" event will be raised so that you can handle the link from the 
outside.

The URL property automatically handles anchors, so you won't see them in 
the Link event handler.

The URL property is also used as a base for the other links included in 
the HTML (css, images...).

So, to correctly display an HTML page in an HtmlView control, you should 
download the HTML and every associated stuff (css, images...) in a 
temporary directory, and use that temporary directory with the HTML file 
name to fill the URL property.

Regards,

-- 
Benoît Minisini


More information about the User mailing list