Windows Develop Bookmark and Share   
 index > Windows Forms General > Displaying HTML within a Windows Form as if it were a WebForm
 

Displaying HTML within a Windows Form as if it were a WebForm

Back when I programmed C++ using ATL there was a way to do this.  Does anyone know if there is a way to do this in .Net using C# for instance.  

Much thanks,
-the rocket
MigrationUser 1  Wednesday, January 29, 2003 1:55 AM
What about using the httpwebrequest class? I haven't tried it myself, but it looks like it might work.
MigrationUser 1  Wednesday, January 29, 2003 8:33 AM
That class looks like a very interesting class and it will let me send and receive HTTP posts and gets asynchronously, however what I am looking for is a way to display HTML from within a Windows Form as if it were a browser window.  This is probably going to be a control and I have been playing around with 'AxSHDocVw.AxWebBrowser' with little success.  What would be very useful at this point would be some sample code.

Thanks very much though,
-the rocket
MigrationUser 1  Wednesday, January 29, 2003 12:49 PM
The only current way to display HTML on a Windows Forms app is with the Web Browser ActiveX Control (shdocvw.dll).  It sounds like this is what you've been experiementing with.  Because this is an ActiveX control there are some limitations, semi trusted access being the primary one.

What issues are you hitting that cause you to descirbe your Web Browser control experience as producing "little success"?

Another option is to convert the HTML to rtf and use the RichTExtBox control to display it.  I'm sure a google search on "HTML to RTF" would get you some samples of this.

good luck
 - mike
MigrationUser 1  Wednesday, January 29, 2003 3:17 PM
I actually got this working but not without much difficulty.  It is not quite as straight forward as it might seem.  I stumbled across this kb article which was a great help and now have it figured out.

http://support.microsoft.com/default.aspx?scid=kb;en-us;325079

Thanks for your suggestions,
-the rocket
MigrationUser 1  Wednesday, January 29, 2003 6:23 PM

Check out the following article in C# Today:

http://www.csharptoday.com/content.asp?id=1980
MigrationUser 1  Wednesday, January 29, 2003 11:42 PM
Thanks batnight this is just what I was looking for.  This is a great article and I heartily recommend it to anyone looking for a rich presentation layer in a Windows Forms app.  Please be aware that you will have to cough up a little coin for it though.

thanks,
-the rocket
MigrationUser 1  Friday, January 31, 2003 1:38 AM

You can use google to search for other answers

Custom Search

More Threads

• Migrating from Windows Forms 1.x to Windows Forms 2.0
• A generic occured in GDI+, while saving image
• Autocomplete combobox
• HelpProvider
• How to find out desktop resolution/size
• Export printdocumt to word document?
• How can I get all the control objects in a form?
• Session Time-out For Windows Application
• Disable cell to cell navigation by arrow keys in windows datagrid
• 1. How can I set tool tip in Button?