Generate HTML content and display it in a WebBrowser control in C#

When the program starts, it uses the following code to make its WebBrowser control go to the user's home page.

// Start at home.
wbrDisplay.GoHome();

When you click the Set Contents button, the program uses the following code to display the HTML code in the upper text box in the WebBrowser.

// Set the HTML contents.
private void btn_Click(object sender, EventArgs e)
{
HtmlDocument doc = wbrDisplay.Document;
doc.Body.InnerHtml = txtHtml.Text;
}

   

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.