Beispiel #1
0
 private void filePrintPreviewMenuItem_Click(object sender, System.EventArgs e)
 {
     if (this.ActiveMdiChild is ChildForm)
     {
         BMDocument doc = (this.ActiveMdiChild as ChildForm).Document;
         doc.SubscribeToPrint(prDoc);
         this.printPreviewDialog.Document = prDoc;
         this.printPreviewDialog.ShowDialog();
         doc.UnsubscribeToPrint(prDoc);
     }
 }
Beispiel #2
0
        private void filePrintMenuItem_Click(object sender, System.EventArgs e)
        {
            if (this.ActiveMdiChild is ChildForm)
            {
                BMDocument doc = (this.ActiveMdiChild as ChildForm).Document;

                try
                {
                    doc.SubscribeToPrint(prDoc);
                    prDoc.Print();
                }
                finally
                {
                    doc.UnsubscribeToPrint(prDoc);
                }
            }
        }