Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:23:26+00:00 2026-05-29T22:23:26+00:00

I am developing a windows application using vb.net, I have a simple html page

  • 0

I am developing a windows application using vb.net, I have a simple html page with place holders in it, I load the page into a stream reader, replace the place holders and then I need to print the html content, anybody have any idea how to print the html content as html and not source.
P.S. code in vb.bet or c# is ok.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:23:27+00:00Added an answer on May 29, 2026 at 10:23 pm

    You can use the WebBrowser control to do so. It will allow you to show HTML inside your WinForms.

    The DocumentText proprety will allow you to set a String that represent the HTML you want to show.

    For example:

    webBrowser.DocumentText = "<html><body><p>I like StackOverflow</p><body></html>";
    

    Afterward if you want to print the page, you’ll have to wait until the Document is completed and call the Print method of the WebBrowser. MSDN shows an easy way to do it:

    private void PrintHelpPage()
    {
        // Create a WebBrowser instance. 
        WebBrowser webBrowserForPrinting = new WebBrowser();
    
        // Add an event handler that prints the document after it loads.
        webBrowserForPrinting.DocumentCompleted +=
            new WebBrowserDocumentCompletedEventHandler(PrintDocument);
    
        // Set the Url property to load the document.
        webBrowserForPrinting.Url = new Uri(@"\\myshare\help.html");
    }
    
    private void PrintDocument(object sender,
        WebBrowserDocumentCompletedEventArgs e)
    {
        // Print the document now that it is fully loaded.
        ((WebBrowser)sender).Print();
    
        // Dispose the WebBrowser now that the task is complete. 
        ((WebBrowser)sender).Dispose();
    }
    

    You should also consider trying to use the method PrintDialog to make sure the issue is not your printing configuration.

    Here is the link to MSDN:
    Print with a WebBrowser control on MSDN

    Possible duplicate:
    Printing WebBrowser control content

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a simple ASP.Net application on a Windows 7 x64 machine using
Hai I am Developing an Windows application using C#.Net where I have to block
I developing ASP.NET application using a Swedish version of Windows XP and Visual studio
I'm developing an winform application for Windows Mobile 5.0 and above. I'm using .Net
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose
I am developing a Windows Application using the .net Framework 2.0 and Visual C#(Microsoft
I am developing a windows application in .NET framework, using C#. At the time
I am developing WPF windows application using VS 2008 and .NET 3.5. I am
I'm developing a windows forms application using VB.NET. I'm currently working on DataReport (by
We developing an Application using .NET Framework 4.0 (C#) windows forms based application. Now,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.