HTML rendering in VB.Net

Hello folks,

I've got probably a simple and stupid question, just feeling tired tonight.

I'm using the googleapi to add more flexibility to searching google from a vb.net app I'm writing.

I get a stream of html data back from google that has a title such as "The <b>best</b> ..." then I get a URL, then a snippet of information about the topic which may or may not have html included.

My problem is how to display this Is there no control that can display html data I could use the webbrowser, but then I'd have to save the file out to an html file on disk and I'd rather avoid that if possible (just seems messy :) ), or is there a way that I can write a URL to the webbrowser as html text (as opposed to having it navigate to the URL) without having to print it out.

I've tried textbox, label, richtextbox etc, but none of them handle html code.

Am I just being dumb tonight or am I overlooking something simple and stupid :)

It just doesn't seem like it's this difficult, but i'm drawing a blank about how to go about it.

Thanks in advance folks!

Dean


Answer this question

HTML rendering in VB.Net

  • Brent K

    Thanks for the reply Renee! I think the DocumentText is just what I'm looking for.
  • MubasherAbad

    Hi Dean,

    No, you're not being dumb.

    There are subtleties in the browser. It's a highly multilayered piece of software.

    You may feel better if you open a new project and did this:

    Dim wb as new webBrowser

    and examined three properties:

    wb.Document
    wb.Documentstream

    and

    wb.Documenttext

    If I am not mistaken, the webBrowser control can deal directly with that stream and I believe you can edit it and do what you like with that stream using MSHTML and the DOM model.

    Also, if you are running a modern day version of windows, there is a strange little ocx and DLL on your system. It is the DHTML Edit control. It's half HTML editor and half webrowser and it's fairly remarkable.

    Microsoft has had an SDK for it and it has been discontinued. However it's around on the net and is downloadable. The control is located (probably) on your system:

    C:\Program Files\Common Files\Microsoft Shared\Triedit

    But... there are caveats about this OCX especially around security. If you use it on the net and encounter a hostile script, it's capable of opening, reading and writing files under script control. There is a secure and non-secure version.

    The name of the sdk on the net is:

    dhedsdk.exe

    But I would recommend that you exhaust all efforts with the current webBrowser first.

    Renee

  • GAJMAN

    YaaaaaaaaaaaaaaaaaaaaaaaaaY !!!!!!!!!!!!! :)

  • Plumpton

    don't forget to Imports System.Windows.Forms


  • fanis

    Hi Renee,

    In this thread you suggest opening a new VB project and declaring:

    dim wb as new webBrowser

    I followed that advice since I'm having issues similar to the one in the thread, but the compiler has no idea what a webBrowser is. After typing as far as the New keyword, the intellisense list contains a Web object, but webBrowser isn't included in the list. Do I need to Import some namespace or other

    Thanks,

    mark



  • HTML rendering in VB.Net