Displaying HTML - I need a tutorial

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Barnett

    #1

    Displaying HTML - I need a tutorial

    I have a desktop application that needs to display some summary information.
    At present I use the RichTextBox control but am unhappy with the results.
    What I would prefer to do is display an HTML page (complete with graphics)
    from within my app.

    The problem is that I have no idea how to go about this and seem to be
    struggling to find an example that creates the web pages on the fly. Can
    anyone point me at a tutorial that deals with displaying HTML from a C#
    desktop app.

    Many thanks
    Steve


  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Displaying HTML - I need a tutorial

    Steve,

    This shouldn't be too hard. You can set a reference to the WebBrowser
    control (right click on the toolbox and select the COM tab, it should be
    there). This is what will display your HTML. Once you have that, you can
    set a reference in your project to the MSHTML libraries (under the COM tab
    when you add a reference). Once you have this, you can use the HTMLDocument
    class to construct your page (if you wish to go that far). Then, just save
    it to a temp directory and point the webbrowser control to that directory.

    Hope this helps.

    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Steve Barnett" <noname@nodomai n.com> wrote in message
    news:%23sdE%23G 9vDHA.2540@TK2M SFTNGP09.phx.gb l...[color=blue]
    > I have a desktop application that needs to display some summary[/color]
    information.[color=blue]
    > At present I use the RichTextBox control but am unhappy with the results.
    > What I would prefer to do is display an HTML page (complete with graphics)
    > from within my app.
    >
    > The problem is that I have no idea how to go about this and seem to be
    > struggling to find an example that creates the web pages on the fly. Can
    > anyone point me at a tutorial that deals with displaying HTML from a C#
    > desktop app.
    >
    > Many thanks
    > Steve
    >
    >[/color]


    Comment

    • Steve Barnett

      #3
      Re: Displaying HTML - I need a tutorial


      And I thought COM was dead.

      Thanks
      Steve

      "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> wrote in
      message news:OEWmYL$vDH A.1764@TK2MSFTN GP10.phx.gbl...
      | Steve,
      |
      | This shouldn't be too hard. You can set a reference to the WebBrowser
      | control (right click on the toolbox and select the COM tab, it should be
      | there). This is what will display your HTML. Once you have that, you can
      | set a reference in your project to the MSHTML libraries (under the COM tab
      | when you add a reference). Once you have this, you can use the
      HTMLDocument
      | class to construct your page (if you wish to go that far). Then, just
      save
      | it to a temp directory and point the webbrowser control to that directory.
      |
      | Hope this helps.
      |
      | --
      | - Nicholas Paldino [.NET/C# MVP]
      | - mvp@spam.guard. caspershouse.co m
      |
      | "Steve Barnett" <noname@nodomai n.com> wrote in message
      | news:%23sdE%23G 9vDHA.2540@TK2M SFTNGP09.phx.gb l...
      | > I have a desktop application that needs to display some summary
      | information.
      | > At present I use the RichTextBox control but am unhappy with the
      results.
      | > What I would prefer to do is display an HTML page (complete with
      graphics)
      | > from within my app.
      | >
      | > The problem is that I have no idea how to go about this and seem to be
      | > struggling to find an example that creates the web pages on the fly. Can
      | > anyone point me at a tutorial that deals with displaying HTML from a C#
      | > desktop app.
      | >
      | > Many thanks
      | > Steve
      | >
      | >
      |
      |


      Comment

      Working...