• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.PrintDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.PrintDialog的典型用法代码示例。如果您正苦于以下问题:C# PrintDialog类的具体用法?C# PrintDialog怎么用?C# PrintDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PrintDialog类属于System.Windows.Forms命名空间,在下文中一共展示了PrintDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Printing

        public void Printing()
        {
            PrintDialog pDialog = new PrintDialog();
            FileStream fs = new FileStream(@"Szervíz_Feltételek.txt", FileMode.Open, FileAccess.Read);
            StreamReader sr = new StreamReader(fs);

            contract = sr.ReadToEnd();

            try
            {
                try
                {
                    PrintDocument pd = new PrintDocument();
                    pd.PrintPage += new PrintPageEventHandler(pd_PrintRent);

                    if (pDialog.ShowDialog() == DialogResult.OK)
                    {
                        pd.PrinterSettings = pDialog.PrinterSettings;
                        // Print the document.
                        pd.Print();
                    }

                }
                finally
                {

                }
            }
            catch (Exception ex)
            {

            }
        }
开发者ID:sikisuti,项目名称:gyorok,代码行数:33,代码来源:printService.cs


示例2: Run

 public override void Run()
 {
     IWorkbenchWindow activeWorkbenchWindow = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
     if (activeWorkbenchWindow != null)
     {
         if (activeWorkbenchWindow.ViewContent is IPrintable)
         {
             PrintDocument printDocument = ((IPrintable) activeWorkbenchWindow.ViewContent).PrintDocument;
             if (printDocument != null)
             {
                 using (PrintDialog dialog = new PrintDialog())
                 {
                     dialog.Document = printDocument;
                     dialog.AllowSomePages = true;
                     if (dialog.ShowDialog(WorkbenchSingleton.MainForm) == DialogResult.OK)
                     {
                         printDocument.Print();
                     }
                 }
             }
             else
             {
                 MessageService.ShowError("${res:SkyMap.Net.Commands.Print.CreatePrintDocumentError}");
             }
         }
         else
         {
             MessageService.ShowError("${res:SkyMap.Net.Commands.Print.CantPrintWindowContentError}");
         }
     }
 }
开发者ID:vanloc0301,项目名称:mychongchong,代码行数:31,代码来源:Print.cs


示例3: ConfirmPrinterSettings

        /// <summary>
        /// Confirms the printer settings.
        /// </summary>
        /// <param name="dvPriced">The dv priced.</param>
        /// <param name="dvUnpriced">The dv unpriced.</param>
        /// <param name="stvPrinterName">Name of the STV printer.</param>
        /// <param name="deliveryNotePrinter">The delivery note printer.</param>
        /// <returns></returns>
        private static bool ConfirmPrinterSettings(DataTable dvPriced, DataTable dvUnpriced, out string stvPrinterName,
                                           out string deliveryNotePrinter)
        {
            // get the printer for the stv.
            PrintDialog dialog = new PrintDialog();
            stvPrinterName = deliveryNotePrinter = "";
            if (dvPriced.Rows.Count > 0 && dialog.ShowDialog() == DialogResult.Cancel)
            {
                return false;
            }

            if (dvPriced.Rows.Count > 0)
            {
                stvPrinterName = dialog.PrinterSettings.PrinterName;
            }

            if (dvUnpriced.Rows.Count > 0)
            {
                if (dvPriced.Rows.Count > 0 &&
                    XtraMessageBox.Show(
                        "This transaction contains both priced items and unpriced items (delivery note). Are you sure you want to proceed?",
                        "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No)
                {
                    return false;
                }

                if (dialog.ShowDialog() == DialogResult.Cancel)
                {
                    return false;
                }
                deliveryNotePrinter = dialog.PrinterSettings.PrinterName;
            }
            return true;
        }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:42,代码来源:InvoiceForm.cs


示例4: MapOutPut

        public MapOutPut(AxPageLayoutControl pagecontrol)
        {
            axPageLayoutControl1 = pagecontrol;

            printDialog1 = new System.Windows.Forms.PrintDialog(); //create a print dialog object
            InitializePageSetupDialog(); //intitialize the page setup dialog

            comboBox1.Items.Add("esriPageMappingTile");
            comboBox1.Items.Add("esriPageMappingCrop");
            comboBox1.Items.Add("esriPageMappingScale");
            comboBox1.SelectedIndex = 0;

            // create a new PrintPreviewDialog using constructor
            printPreviewDialog1 = new PrintPreviewDialog();
            //set the size, location, name and the minimum size the dialog can be resized to
            printPreviewDialog1.ClientSize = new System.Drawing.Size(800, 600);
            printPreviewDialog1.Location = new System.Drawing.Point(29, 29);
            printPreviewDialog1.Name = "PrintPreviewDialog1";
            printPreviewDialog1.MinimumSize = new System.Drawing.Size(375, 250);
            //set UseAntiAlias to true to allow the operating system to smooth fonts
            printPreviewDialog1.UseAntiAlias = true;

            //associate the event-handling method with the document's PrintPage event
            this.document.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(document_PrintPage);
        }
开发者ID:xfgxfg,项目名称:CropWatchField,代码行数:25,代码来源:MapOutPut.cs


示例5: PrintClicked

        private void PrintClicked(object sender, System.EventArgs e)
        {
            if (Viewer == null)
            {
                return;
            }

            PrintDocument pd = new PrintDocument();
            pd.DocumentName = Viewer.SourceFile.LocalPath;
            pd.PrinterSettings.FromPage = 1;
            pd.PrinterSettings.ToPage = Viewer.PageCount;
            pd.PrinterSettings.MaximumPage = Viewer.PageCount;
            pd.PrinterSettings.MinimumPage = 1;
            pd.DefaultPageSettings.Landscape = Viewer.PageWidth > Viewer.PageHeight ? true : false;
            using (PrintDialog dlg = new PrintDialog())
            {
                dlg.Document = pd;
                dlg.AllowSelection = true;
                dlg.AllowSomePages = true;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    Viewer.Print(pd);
                }
            }

        }
开发者ID:myersBR,项目名称:My-FyiReporting,代码行数:26,代码来源:ViewerToolstrip.cs


示例6: Execute

        public override void Execute()
        {
            printDocument = new PrintDocument();

              printDocument.OriginAtMargins = true;
              printDocument.BeginPrint += new PrintEventHandler(printDocument_BeginPrint);
              printDocument.PrintPage += new PrintPageEventHandler(printDocument_PrintPage);

              Dictionary<String, Object> paperSettings = Printing.getPaperSettings(grtArguments);
              printDocument.DefaultPageSettings.Landscape = (string)paperSettings["orientation"] == "landscape";

              // Sizes must be given in inch * 100 (sigh).
              int paperWidth = (int)Math.Round((double)paperSettings["width"] / 0.254);
              int paperHeight = (int)Math.Round((double)paperSettings["height"] / 0.254);
              PaperSize paperSize = new PaperSize("Doesn't matter", paperWidth, paperHeight);
              printDocument.DefaultPageSettings.PaperSize = paperSize;

              if ((bool)paperSettings["marginsSet"])
            printDocument.DefaultPageSettings.Margins =
              new Margins((int)paperSettings["marginLeft"], (int)paperSettings["marginRight"],
            (int)paperSettings["marginTop"], (int)paperSettings["marginBottom"]);

              printDialog = new System.Windows.Forms.PrintDialog();
              printDialog.Document = printDocument;
              printDialog.AllowPrintToFile = true;

              pageNumber = 0;
              pageCount = -1;

              if (printDialog.ShowDialog() == DialogResult.OK)
              {
            printDocument.Print();
              }
        }
开发者ID:abibell,项目名称:mysql-workbench,代码行数:34,代码来源:PrintDialog.cs


示例7: btstampa_Click

        private void btstampa_Click(object sender, EventArgs e)
        {
            string imageFilePath = Globalne.pathfolder + "\\priznanica.bmp";
            Bitmap bitmap = (Bitmap)Image.FromFile(imageFilePath);//load the image file

            using (Graphics graphics = Graphics.FromImage(bitmap))
            {
                using (Font f = new Font("Times New Roman", 12))
                {
                    Point loc = new Point(480, 262);

                    Size s1 = new Size(134, 31);
                    Rectangle rec = new Rectangle(loc, s1);
                    graphics.DrawString(DateTime.Today.ToString().Substring(0, DateTime.Today.ToString().Length - 12), f, Brushes.Black, rec);
                    rec.X = 485;
                    rec.Y = 303;
                    graphics.DrawString(ukupno.ToString(), f, Brushes.Black, rec);

                }
            }

            bitmap.Save(Globalne.pathfolder + "\\priznanicaP.bmp");

                PrintDialog printDialog = new PrintDialog();
                printDialog.Document = printDocument1;
                printDialog.UseEXDialog = true;
                if (DialogResult.OK == printDialog.ShowDialog())
                {
                    printDocument1.DocumentName = "Račun";
                    printDocument1.Print();
                }
        }
开发者ID:filipxa,项目名称:Molim_te_nemoj_vise,代码行数:32,代码来源:racun.cs


示例8: Print

        private bool Print(bool showPrintDialog, ScintillaPrintDocument doc)
        {
            if (showPrintDialog)
            {
                var pd = new PrintDialog();
                pd.Document = doc;
                pd.UseEXDialog = true;
                pd.AllowCurrentPage = true;
                pd.AllowSelection = true;
                pd.AllowSomePages = true;
                pd.PrinterSettings = doc.DefaultPageSettings.PrinterSettings;

                if (pd.ShowDialog(WB.Form) == DialogResult.OK)
                {
                    doc.PrinterSettings = pd.PrinterSettings;
                    doc.Print();
                    return true;
                }

                return false;
            }

            doc.Print();
            return true;
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:25,代码来源:PrintService.cs


示例9: A4PrintSelectPrint

        public bool A4PrintSelectPrint(string printContent, int printContentLineCount)
        {
            //PrintDocument doc = new TextDocument(printContent, printContentLineCount);
            PrintDocument doc = new TextDocument(printContent);//@Salim

            doc.PrintPage += this.printDocument1_PrintPage;

            PrintDialog printDialog1 = new PrintDialog();

            // pageSetupDialog1 = new PageSetupDialog();

            if (printDialog1.ShowDialog() == DialogResult.OK)
            {
                // printDialog1.ShowDialog();

                if (printDialog1.PrinterSettings.PrinterName != null)
                {
                    if (printDialog1.PrinterSettings.PrinterName != null)
                    {
                        doc.DefaultPageSettings.PrinterSettings.PrinterName = printDialog1.PrinterSettings.PrinterName;
                        // doc.DefaultPageSettings.PrinterSettings.PrinterName = printDialog1.PrinterSettings.PaperSizes ;
                    }

                    doc.DefaultPageSettings.Landscape = true;
                    PrintDialog dlgSettings = new PrintDialog();
                    dlgSettings.Document = doc;

                    //if (dlgSettings.ShowDialog() == DialogResult.OK)
                    //{
                    doc.Print();
                }
            }
            return true;
        }
开发者ID:Jusharra,项目名称:RMS,代码行数:34,代码来源:PrintUtility.cs


示例10: print

        public void print()
        {
            PrintDialog pd = new PrintDialog();
            PrintDocument pdoc = new PrintDocument();
            PrinterSettings ps = new PrinterSettings();
            Font font =new Font("Arial",12);
            PaperSize psize = new PaperSize("Custome", 100, 200);
            pd.Document = pdoc;
            pd.Document.DefaultPageSettings.PaperSize = psize;
            pdoc.DefaultPageSettings.PaperSize.Height = 320;
            pdoc.DefaultPageSettings.PaperSize.Width = 200;
            pdoc.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
            DialogResult result = pd.ShowDialog();
            if (result == DialogResult.OK)
            {
                PrintPreviewDialog ppd = new PrintPreviewDialog();
                ppd.Document = pdoc;
                result = ppd.ShowDialog();
                if (result == DialogResult.OK)
                {
                    pdoc.Print();

                }
            }



        }
开发者ID:neyosuraj,项目名称:thisistestRepository,代码行数:28,代码来源:orderlist.cs


示例11: print

        public void print()
        {
            PrintDialog pd = new PrintDialog();
            pdoc = new PrintDocument();
            PrinterSettings ps = new PrinterSettings();
            Font font = new Font("Courier New", 15);

            PaperSize psize = new PaperSize("Custom", 300, 100);
            ps.DefaultPageSettings.PaperSize = psize;

            pd.Document = pdoc;
            pd.Document.DefaultPageSettings.PaperSize = psize;

            pdoc.DefaultPageSettings.PaperSize = psize;

            pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

            DialogResult result = pd.ShowDialog();
            if (result == DialogResult.OK)
            {
                PrintPreviewDialog pp = new PrintPreviewDialog();
                pp.Document = pdoc;

                result = pp.ShowDialog();
                if (result == DialogResult.OK)
                {
                    pdoc.Print();
                }
            }
        }
开发者ID:hydrohead,项目名称:MWSZonBarcode,代码行数:30,代码来源:Printing.cs


示例12: Print

 public override void Print(bool ShowDialog)
 {
     printDoc = new PrintDocument();
         printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage);
         pd = new PrintDialog();
         pd.Document = printDoc;
         pd.AllowSomePages = true;
         if ((!ShowDialog) || (pd.ShowDialog() == DialogResult.OK))
         {
             printDoc.DocumentName = "debuglog-" + DateTime.Now.Date.ToShortDateString() + ".txt";
             strPrintText = RawTrafficText.Text.Length > 0 ? RawTrafficText.Text : " ";
             switch (pd.PrinterSettings.PrintRange)
             {
                 case PrintRange.AllPages:
                     startPage = 1;
                     totalPages = pd.PrinterSettings.MaximumPage;
                     break;
                 case PrintRange.SomePages:
                     startPage = pd.PrinterSettings.FromPage;
                     totalPages = pd.PrinterSettings.ToPage - startPage + 1;
                     break;
             }
             // start printing
             pageNumber = 1;
             printDoc.Print();
         }
 }
开发者ID:HBelusca,项目名称:NasuTek-Odyssey-Tools,代码行数:27,代码来源:RawTraffic.cs


示例13: print

        public void print()
        {
            PrintDialog pd = new PrintDialog();
            pdoc = new PrintDocument();
            PrinterSettings ps = new PrinterSettings();
            Font font = new Font("Courier New", 15);

             //PaperSize psize = new PaperSize("Custom", 219, 1000);
            pd.Document = pdoc;
            //pd.Document.DefaultPageSettings.PaperSize = psize;

            if (pd.Document.DefaultPageSettings.PaperSize.Width <= 284)
            {
                k = Convert.ToDouble(pd.Document.DefaultPageSettings.PaperSize.Width) / 284;
            }

            pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

            DialogResult result = pd.ShowDialog();
            if (result == DialogResult.OK)
            {
                PrintPreviewDialog pp = new PrintPreviewDialog();
                pp.Document = pdoc;
                System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
                pp.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
                pp.PrintPreviewControl.Zoom = 1f;
                result = pp.ShowDialog();
                if (result == DialogResult.OK)
                {
                    pdoc.Print();
                }
            }
        }
开发者ID:ochirpurev,项目名称:CSPosAPI,代码行数:33,代码来源:MainForm.cs


示例14: SetupThePrinting

        // The printing setup function
        private bool SetupThePrinting()
        {
            PrintDialog MyPrintDialog = new PrintDialog();
               MyPrintDialog.AllowCurrentPage = false;
               MyPrintDialog.AllowPrintToFile = false;
               MyPrintDialog.AllowSelection = false;
               MyPrintDialog.AllowSomePages = false;
               MyPrintDialog.PrintToFile = false;
               MyPrintDialog.ShowHelp = false;
               MyPrintDialog.ShowNetwork = false;

               if (MyPrintDialog.ShowDialog() != DialogResult.OK)
            return false;
               MyPrintDocument.DocumentName = "Planilla de ventas peluquería";
               MyPrintDialog.PrinterSettings.DefaultPageSettings.Landscape = true; //página horizontal
               //MyPrintDialog.PrinterSettings.DefaultPageSettings.Landscape = false; //página vertical
               MyPrintDocument.PrinterSettings = MyPrintDialog.PrinterSettings;
               MyPrintDocument.DefaultPageSettings = MyPrintDialog.PrinterSettings.DefaultPageSettings;
               MyPrintDocument.DefaultPageSettings.Margins = new Margins(40, 40, 40, 40);

               //if (MessageBox.Show("¿Desea centrar el reporte en la pagina?",
               // "InvoiceManager - Center on Page", MessageBoxButtons.YesNo,
               // MessageBoxIcon.Question) == DialogResult.Yes)
               // MyDataGridViewPrinter = new DataGridViewPrinter(MyDataGridView,
               // MyPrintDocument, true, true, "Listado Completo de Facturas", new Font("Tahoma", 15,
               // FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);
               //else
               string encabezado = "Vendedor: Cecilia Toscani             Zona: " + txtZona.Text + "               Fecha: " + DateTime.Now.ToLongDateString();
            MyDataGridViewPrinter = new DataGridViewPrinter(MyDataGridView,
            MyPrintDocument, false, true, encabezado, new Font("Tahoma", 13,
            FontStyle.Bold, GraphicsUnit.Point), Color.Black, true);
               return true;
        }
开发者ID:numenio,项目名称:Sistema-Ventas-Peluqueria,代码行数:34,代码来源:frmImprimir.cs


示例15: StartPrint

        //Stream streamToPrint, string streamType
        //2�����Print��ӡ����
        public void StartPrint()
        {
            //����ֵ��PageSettings A4\A5
            PageSettings ps = new PageSettings();
            //��ʾ���ô�ӡҳ�Ի���
            PageSetupDialog Psdl = new PageSetupDialog();
            //��ӡ������ã�ע�⣬�÷��������printpage�������档
            PrintDialog pt = new PrintDialog();
            pt.AllowCurrentPage = true;
            pt.AllowSomePages = true;
            pt.AllowPrintToFile = true;
            //       StreamToPrint = streamToPrint;//��ӡ���ֽ���
            //       StreamType = streamType; //��ӡ������
            //       printDocument1.DocumentName = Filename; //��ӡ���ļ���
            Psdl.Document = printDocument1;
            //       PrintPreview.Document = printDocument1;
            pt.Document = printDocument1;
            Psdl.PageSettings = printDocument1.DefaultPageSettings;
            try
            {
                //ҳ�����öԻ���
                if (Psdl.ShowDialog() == DialogResult.OK)
                {
                    ps = Psdl.PageSettings;
                    printDocument1.DefaultPageSettings = Psdl.PageSettings;
                }
                //ѡ���ӡ���Ի���
                if (pt.ShowDialog() == DialogResult.OK)
                {
                    printDocument1.PrinterSettings.Copies = pt.PrinterSettings.Copies;
                    //printDocument1.Print();
                    if (!checkBoxAll.Checked)
                    {
                        printDocument1.Print();
                    }
                    else
                    {
                        for (int i = 0; i < dataGridView1.RowCount; i++)
                        {
                            ShowTag(i);
                            printDocument1.Print();
                        }
                    }

                }
                ////��ӡԤ���Ի���
                //if (PrintPreview.ShowDialog() == DialogResult.OK)
                //{
                //    //���ô�ӡ
                //    printDocument1.Print();
                //}

                //PrintDocument�����Print()������PrintController����ִ��PrintPage�¼���
            }
            catch (InvalidPrinterException ex)
            {
                MessageBox.Show(ex.Message, "Simple Editor", MessageBoxButtons.OK, MessageBoxIcon.Error);
                throw;
            }
        }
开发者ID:chutinhha,项目名称:asset-management-system,代码行数:62,代码来源:PrintDlg.cs


示例16: Printing

        //private void CalcTotalCost()
        //{
        //    long gID = rentalsToPrint[0].groupID;
        //    deposit = (long)SQLConnection.Execute.RentalGroupsTable.Single(rg => rg.groupID == gID).deposit;
        //    totalCost = 0;
        //    foreach (var item in rentalsToPrint)
        //    {
        //        //if (item.isPaid != true)
        //        //{
        //            totalCost += calc.getRentCost(item.rentalStart, item.rentalEnd, (long)item.actualPrice, (float)item.discount); // (long)((item.rentalEnd - item.rentalStart).Days * item.actualPrice * (1 - item.discount));
        //        //}
        //    }
        //    //totalCost -= deposit;
        //}
        //private string CalcPartCost(DateTime start, DateTime end, long price, float discount)
        //{
        //    int hours;
        //    hours = calc.getIntervalInHours(start, end);
        //    if (hours == 0)
        //    {
        //        hours = 1;
        //    }
        //    return ((long)Math.Round((double)(hours * (price / 10) * (1 - discount)), 0)).ToString("C0");
        //}
        public void Printing()
        {
            //long rtpID;
            PrintDialog pDialog = new PrintDialog();
            try
            {
                FileStream fs = new FileStream(@"Kölcsönzés_Feltételek.txt", FileMode.Open, FileAccess.Read);
                StreamReader sr = new StreamReader(fs);
                contract = sr.ReadToEnd();
            }
            catch (Exception)
            {
                contract = string.Empty;
            }

            //CalcTotalCost();

            try
            {
                    PrintDocument pd = new PrintDocument();
                    pd.PrintPage += new PrintPageEventHandler(pd_PrintRent);

                    if (pDialog.ShowDialog() == DialogResult.OK)
                    {
                        pd.PrinterSettings = pDialog.PrinterSettings;
                        // Print the document.
                        pd.Print();
                    }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
开发者ID:sikisuti,项目名称:gyorok,代码行数:58,代码来源:PrintRent.cs


示例17: DoPrint

        public void DoPrint() {
            PrintDialog printDialog = new PrintDialog();

            docToPrint.DocumentName = this.documentName;
            printDialog.AllowSomePages = true;

            printDialog.ShowHelp = true;

            printDialog.Document = docToPrint;

            DialogResult result = printDialog.ShowDialog();

            docToPrint.PrintPage += new PrintPageEventHandler(document_PrintPage);

            pages = this.printPageList.Count;
            currentPage = 0;
            if (this.printPageList.Count <= 0)
                return;

            if (result == DialogResult.OK) {
                try {
                    docToPrint.Print();
                } catch (Exception e) {
                    MessageBox.Show("Fehler beim Drucken: " + e.ToString());
                }
            }
            
        }
开发者ID:tgassner,项目名称:WasserWerkVerwaltung,代码行数:28,代码来源:PrintableDocument.cs


示例18: btnPrint_Click

        private void btnPrint_Click(object sender, EventArgs e)
        {
            PrintDialog pd = new PrintDialog();
            pdoc = new PrintDocument();
            PrinterSettings ps = new PrinterSettings();
            Font font = new Font("Courier New", 15);

            PaperSize psize = new PaperSize("Custom", 100, 200);

            pd.Document = pdoc;
            pd.Document.DefaultPageSettings.PaperSize = psize;
            pdoc.DefaultPageSettings.PaperSize.Height = 720;

            pdoc.DefaultPageSettings.PaperSize.Width = 620;

            pdoc.PrintPage += new PrintPageEventHandler(pdoc_PrintPage);

            DialogResult result = pd.ShowDialog();
            if (result == DialogResult.OK)
            {
                PrintPreviewDialog pp = new PrintPreviewDialog();
                pp.Document = pdoc;
                result = pp.ShowDialog();
                if (result == DialogResult.OK)
                {
                    pdoc.Print();
                }
            }
        }
开发者ID:thanhhnk,项目名称:ProP_LoopIT,代码行数:29,代码来源:FoodShop.cs


示例19: Print

        public bool Print(bool showPrintDialog)
        {
            if (showPrintDialog)
            {
                var pd = new PrintDialog
                {
                    Document = this._printDocument,
                    UseEXDialog = true,
                    AllowCurrentPage = true,
                    AllowSelection = true,
                    AllowSomePages = true,
                    PrinterSettings = this.PageSettings.PrinterSettings
                };

                if (pd.ShowDialog(Scintilla) == DialogResult.OK)
                {
                    this._printDocument.PrinterSettings = pd.PrinterSettings;
                    this._printDocument.Print();
                    return true;
                }

                return false;
            }

            this._printDocument.Print();
            return true;
        }
开发者ID:borisblizzard,项目名称:arcreator,代码行数:27,代码来源:Printing.cs


示例20: btnin_Click

 private void btnin_Click(object sender, EventArgs e)
 {
     if(issave == false)
     {
         if(MessageBox.Show("Bạn phải lưu trước khi in, lưu ngay?", "Thông báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             btnluu.PerformClick();
             System.Drawing.Printing.PrintDocument myPrintDocument1 = new System.Drawing.Printing.PrintDocument();
             PrintDialog myPrinDialog1 = new PrintDialog();
             myPrintDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(myPrintDocument2_PrintPage);
             myPrinDialog1.Document = myPrintDocument1;
             if (myPrinDialog1.ShowDialog() == DialogResult.OK)
             {
                 myPrintDocument1.Print();
                 MessageBox.Show("In phiếu đặt chỗ thành công!", "Thông báo");
             }
         }
         else
         {
             System.Drawing.Printing.PrintDocument myPrintDocument1 = new System.Drawing.Printing.PrintDocument();
             PrintDialog myPrinDialog1 = new PrintDialog();
             myPrintDocument1.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(myPrintDocument2_PrintPage);
             myPrinDialog1.Document = myPrintDocument1;
             if (myPrinDialog1.ShowDialog() == DialogResult.OK)
             {
                 myPrintDocument1.Print();
                 MessageBox.Show("In phiếu đặt chỗ thành công!", "Thông báo");
             }
         }
     }
 }
开发者ID:trantuuit,项目名称:QLBanVeChuyenBay,代码行数:31,代码来源:LapPhieuDatCho.cs



注:本文中的System.Windows.Forms.PrintDialog类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.PrintPreviewDialog类代码示例发布时间:2022-05-26
下一篇:
C# Forms.PreviewKeyDownEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap