Ejemplo n.º 1
0
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            mshtml.IHTMLDocument2 doc = webBrowser1.Document as mshtml.IHTMLDocument2;
            doc.execCommand("Print", true, 0);
            doc.close();

            ViewModel.SetPrintControlsVisibility(false);
        }
Ejemplo n.º 2
0
        private void File_Print(object sender, RoutedEventArgs e)
        {
            string printContents;

            printContents = ViewModel.GetPrintContents();

            mshtml.IHTMLDocument2 doc = webBrowser1.Document as mshtml.IHTMLDocument2;
            doc.clear();
            doc.write(printContents);
            doc.execCommand("Print", true, 0);
            doc.close();
        }