If it can help, here is the code I used :

using System;
using System.Windows.Forms;

public class Form1 : Form
{
    private WebBrowser webBrowser1 = new WebBrowser();
    private Button button1 = new Button();

    [STAThread]
    public static void Main()
    {
        Application.EnableVisualStyles();
        Application.Run(new Form1());
    }

    public Form1()
    {
        button1.Text = "Print";
        button1.Dock = DockStyle.Top;
        button1.Click += new EventHandler(button1_Click);
        webBrowser1.Dock = DockStyle.Fill;
        Controls.Add(webBrowser1);
        Controls.Add(button1);
        Load += new EventHandler(Form1_Load);
        Text = "Internet Explorer";
    }

    private void Form1_Load(object sender, EventArgs e)
    {

       
webBrowser1.Navigate("http://www.javascriptkit.com/howto/newtech2.shtml";);
    }

    private void button1_Click(object sender, EventArgs e)
    {
        webBrowser1.Document.InvokeScript("print");
    }

}

It's a modified example found in MSDN. The web page is a Javascript tutorial
where you can test the "print" function.
-- 
View this message in context: 
http://www.nabble.com/WebBrowser-%2B-Printing-tp20745942p20902408.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to