Beispiel #1
0
 private void Do_Print()
 {
     if (PrintPreviewChkBox.Checked)
     {
         PreviewDoc.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 1094, 1546);
         PrintPrev.Document = PreviewDoc;
         ((Form)PrintPrev).StartPosition = FormStartPosition.CenterScreen;
         DialogResult result = PrintPrev.ShowDialog();
         if (result == DialogResult.OK)
         {
             PreviewDoc.Print();
         }
     }
     else if (PrintChkBox.Checked)
     {
         PrintDial.Document = PreviewDoc;
         PrintDial.PrinterSettings.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 1094, 1546);
         PrintDial.PrinterSettings.Copies = 2;
         DialogResult result = PrintDial.ShowDialog();
         if (result == DialogResult.OK)
         {
             PrintDoc.Print();
         }
     }
 }
Beispiel #2
0
        private void PrintBtn_Click(object sender, EventArgs e)
        {
            pagecount = 1;
            AA        = 1;
            PreviewDoc.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 1094, 1546);
            PrintPrev.Document = PreviewDoc;
            ((Form)PrintPrev).StartPosition = FormStartPosition.CenterScreen;
            PrintPrev.ShowDialog();

            /*
             * PrintDial.Document = PrintDoc;
             * PrintDial.PrinterSettings.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 1094, 1546);
             * PrintDial.PrinterSettings.Copies = 2;
             * DialogResult result = PrintDial.ShowDialog();
             * if (result == DialogResult.OK)
             * {
             *  PrintDoc.Print();
             * }
             */
        }