View RSS Feed

benrwb

  1. Winforms WebBrowser control

    by , 11th April 2011 at 01:06 PM
    I've been playing around with the WinForms WebBrowser control this morning, and after lots of experimentation have finally figured out how to use some of the printing functionality.

    First of all, Add a Reference to SHDocVw. (Project > Add Reference > Browse > C:\Windows\System32\shdocvw.dll)

    Secondly load a document into the browser using webBrowser1.Navigate(url).

    Then,
    to do "Print Preview"...
    Code:
    IWebBrowser2 browser
    ...
    Tags: coding, visual c#
    Categories
    Uncategorized