Exemplo n.º 1
0
    public void Print(string name)
    {
        SourceCodePrintDocument printDocument = getPrintDocument(name);
        PrintDialog             print         = new PrintDialog()
        {
            Document = printDocument
        };

        if (print.ShowDialog() == DialogResult.OK)
        {
            printDocument.Print();
        }
    }
Exemplo n.º 2
0
        private void mnuFile_Print_Click(object sender, EventArgs e)
        {
            if (ActiveMdiChild == null)
            {
                return;
            }
            var ef = (EditForm)ActiveMdiChild;
            var pd = new SourceCodePrintDocument(ef.sDoc);

            dlgPrint.Document = pd;
            if (dlgPrint.ShowDialog(this) == DialogResult.OK)
            {
                pd.Print();
            }
        }