Displaying HTML - I need a tutorial

  • Thread starter Thread starter Steve Barnett
  • Start date Start date
S

Steve Barnett

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
 
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.
 
And I thought COM was dead.

Thanks
Steve

message | 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]
| - (e-mail address removed)
|
| | > 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
| >
| >
|
|
 
Back
Top