"Paste HTML Directly" into WebBrowser object

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Locked
User avatar
fkapnist
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece
Contact:

"Paste HTML Directly" into WebBrowser object

Post by fkapnist »

The NeoBook WebBrowser object currently allows you to link to an Internet address, to an external local HTML file, to a Variable or to an Embedded file.
But if you had the option of "Paste HTML Directly" into the WebBrowser object itself, that would be a lot easier to make changes to the HTML without having to look for its filename somewhere on your hard drive. The pasted HTML would just be a flat text block inside the WebBrowser object and easy to find....

Image

It could be similar to the Function Library so the PUB file would not get too big, but each WebBrowser object could have its own built-in HTML editor that automatically opens the HTML code you pasted into it...

:?:
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: "Paste HTML Directly" into WebBrowser object

Post by dpayer »

This is what most of use the BrowserLoadFromString command for.

Image
David Payer
Des Moines, Iowa
USA
User avatar
fkapnist
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece
Contact:

Re: "Paste HTML Directly" into WebBrowser object

Post by fkapnist »

dpayer wrote:This is what most of use the BrowserLoadFromString command for.

Image
I did try that... Here's my question: Suppose I want to put a block of HTML into my WebBrowser2. The Action tabs for WebBrowser2 are: Before Navigate, Dowload Begin, Complete, Navigate Complete. But if I put BrowserLoadFromString into any of those tabs, nothing happens. If I put BrowserLoadFromString into a button or into other object's Action, then it works okay: my HTML loads into WebBrowser2. But the button might actually be some pages away from WebBrowser2 in my design display. The only way to locate the particular HTML code that loads into WebBrowser2 is by remembering where it is in the object list, or to open each one by one (it is probably no harder to look up .html files on the hard drive)....

I thought it would be more intuitive to edit the HTML code directly in the tab of the WebBrowser object that it appears in, rather than to edit it somewhere else....

:roll:
.
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: "Paste HTML Directly" into WebBrowser object

Post by Gaev »

fkapnist:
Suppose I want to put a block of HTML into my WebBrowser2
Did you mean ...

a) insert a block of HTML within the current HTML being rendered in the specified WebBrowser object ?

or

b) replace the current HTML being rendered in the specified WebBrowser object ?
User avatar
Gaev
Posts: 3782
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada
Contact:

Re: "Paste HTML Directly" into WebBrowser object

Post by Gaev »

fkapnist:
But the button might actually be some pages away from WebBrowser2 in my design display. The only way to locate the particular HTML code that loads into WebBrowser2 is by remembering where it is in the object list,
You might consider placing each BrowserLoadFromString command in a SubRoutines ... and give each SubRoutine a name that is easy to understand/distinguish e.g. RenderAbcInBrowser2 ... and do GoSub to these SubRoutines from inside the Button code.

Now, you can manage all such HTML Strings in one place ... F12 ... and then navigate to the desired SubRoutine.

A variation of this could be a single Called Function that is passed a similarly named parameter.
Locked