Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying a string of HTML in a windows form

Status
Not open for further replies.

Millzy01

Programmer
Jan 11, 2007
20
GB
Hi,
I know this question has been asked before but i cant find seem to find the answer i'm looking for. I have a string of html that I want to display in a windows form without writing a it to file first, is this possible if so can anyone point me in the right direction.

Thanks

Dave
 
Place a Literal control onto your form where you want the html to go, then in your code behind set the Text property of the literal control to your html string.

Senior Software Developer
 
Oops... my bad. You were talking about html and it made me think you were building a ASP.NET application. I then realized I wasn't in the ASP.NET Forum. LOL!

Senior Software Developer
 
i'm guessing this option is not available if you are using VS2003?
 
You need to use a WebBrowser control , but you will need to create a file (.htm, .htmll, etc.) first.
 
i was trying to avoid creating a file first but it looks like it may be the only way.

Thanks for your help guys
 
Sirius is correct, just use the DocumentTextProperty and set it to your HTML string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top