当前位置: 首页>>代码示例>>C#>>正文


C# PageSetupDialog.ShowDialog方法代码示例

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


在下文中一共展示了PageSetupDialog.ShowDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowPageSetupDialog

		public DialogResult ShowPageSetupDialog()
		{
			PageSetupDialog psd = new PageSetupDialog();
			psd.PageSettings = PageSettings;
			psd.PrinterSettings = PageSettings.PrinterSettings;
			return psd.ShowDialog();
		}
开发者ID:dbbotkin,项目名称:PrimeComm,代码行数:7,代码来源:Printing.cs

示例2: Print_DataGridView

        public static void Print_DataGridView(DataGridView dgv1, string printTitle, bool printAllRows, bool fitToPageWidth)
        {
            PrintPreviewDialog ppvw;
            try
            {

                // Getting DataGridView object to print
                dgv = dgv1;

                // Getting all Coulmns Names in the DataGridView
                AvailableColumns.Clear();
                foreach (DataGridViewColumn c in dgv.Columns)
                {
                    if (!c.Visible) continue;
                    AvailableColumns.Add(c.HeaderText);
                }

                // Showing the PrintOption Form
                //PrintOptions dlg = new PrintOptions(AvailableColumns);
                //if (dlg.ShowDialog() != DialogResult.OK) return;

                PrintTitle = printTitle;
                PrintAllRows = printAllRows;
                FitToPageWidth = fitToPageWidth;
                SelectedColumns = AvailableColumns;

                RowsPerPage = 0;

                ppvw = new PrintPreviewDialog();
                PageSetupDialog psd = new PageSetupDialog();
                psd.Document = printDoc;
                psd.ShowDialog();
                printDoc.DefaultPageSettings = psd.PageSettings;
                ppvw.Document = printDoc;

                // Showing the Print Preview Page
                printDoc.BeginPrint += new System.Drawing.Printing.PrintEventHandler(PrintDoc_BeginPrint);
                printDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
                //printDoc.QueryPageSettings += new System.Drawing.Printing.QueryPageSettingsEventHandler(printDoc_QueryPageSettings);
                if (ppvw.ShowDialog() != DialogResult.OK)
                {
                    printDoc.BeginPrint -= new System.Drawing.Printing.PrintEventHandler(PrintDoc_BeginPrint);
                    printDoc.PrintPage -= new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
                    return;
                }

                // Printing the Documnet
                printDoc.Print();
                printDoc.BeginPrint -= new System.Drawing.Printing.PrintEventHandler(PrintDoc_BeginPrint);
                printDoc.PrintPage -= new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {

            }
        }
开发者ID:Avaruz,项目名称:Avaruz.FrameWork,代码行数:60,代码来源:PrintDV.cs

示例3: 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

示例4: DoPageSetup

        /// <summary>
        /// Display a <see cref="PageSetupDialog" /> to the user, allowing them to modify
        /// the print settings for this <see cref="ZedGraphControl" />.
        /// </summary>
        public void DoPageSetup()
        {
            PrintDocument pd = PrintDocument;

            // Add a try/catch pair since the users of the control can't catch this one
            try {
                if (pd != null) {
                    //pd.PrintPage += new PrintPageEventHandler( GraphPrintPage );
                    PageSetupDialog setupDlg = new PageSetupDialog();
                    setupDlg.Document = pd;

                    if (setupDlg.ShowDialog() == DialogResult.OK) {
                        pd.PrinterSettings = setupDlg.PrinterSettings;
                        pd.DefaultPageSettings = setupDlg.PageSettings;

                        // BUG in PrintDocument!!!  Converts in/mm repeatedly
                        // http://support.microsoft.com/?id=814355
                        // from http://www.vbinfozine.com/tpagesetupdialog.shtml, by Palo Mraz
                        //if ( System.Globalization.RegionInfo.CurrentRegion.IsMetric )
                        //{
                        //	setupDlg.Document.DefaultPageSettings.Margins = PrinterUnitConvert.Convert(
                        //	setupDlg.Document.DefaultPageSettings.Margins,
                        //	PrinterUnit.Display, PrinterUnit.TenthsOfAMillimeter );
                        //}
                    }
                }
            }

            catch (Exception exception) {
                MessageBox.Show(exception.Message);
            }
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:36,代码来源:ZedGraphControl.Printing.cs

示例5: ShowPageSettingsDialog

 /// <summary>
 /// Shows the page settings dialog</summary>
 public void ShowPageSettingsDialog()
 {
     PageSetupDialog pageSetupDialog = new PageSetupDialog();
     PrintDocument printDocument = GetPrintDocument();
     pageSetupDialog.Document = printDocument;
     pageSetupDialog.ShowDialog();
 }
开发者ID:JanDeHud,项目名称:LevelEditor,代码行数:9,代码来源:StandardPrintCommands.cs

示例6: ShowPageSetupDialog

 public DialogResult ShowPageSetupDialog(ScintillaPrintDocument doc)
 {
     var psd = new PageSetupDialog();
     psd.AllowPrinter = true;
     psd.PageSettings = doc.DefaultPageSettings;
     psd.PrinterSettings = doc.DefaultPageSettings.PrinterSettings;
     return psd.ShowDialog(WB.Form);
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:8,代码来源:PrintService.cs

示例7: filePageSetupMenuItem_Click

 public void filePageSetupMenuItem_Click(Object sender, EventArgs e)
 {
     PageSetupDialog pageSetupDialog = new PageSetupDialog();
     pageSetupDialog.PageSettings = _pageSettings;
     pageSetupDialog.PrinterSettings = _printSettings;
     pageSetupDialog.AllowOrientation = true;
     pageSetupDialog.AllowMargins = true;
     pageSetupDialog.ShowDialog();
 }
开发者ID:sorvis,项目名称:Fast-Script,代码行数:9,代码来源:PagePrinter.cs

示例8: PageSetupDialog

 void IPrinter.ShowPageSettings()
 {
     PageSetupDialog pageSetupDialog = new PageSetupDialog();
     pageSetupDialog.PageSettings = pgSettings;
     pageSetupDialog.PrinterSettings = prtSettings;
     pageSetupDialog.AllowOrientation = true;
     pageSetupDialog.AllowMargins = true;
     pageSetupDialog.ShowDialog();
 }
开发者ID:k4gdw,项目名称:GSharpTools,代码行数:9,代码来源:TextPrinter.cs

示例9: PageSetupButton_Click

        private void PageSetupButton_Click(object sender, EventArgs e)
        {
            PageSetupDialog pageSetupDialog = new PageSetupDialog();

            pageSetupDialog.PageSettings = m_DocumentPageSettings;

            if (pageSetupDialog.ShowDialog() == DialogResult.OK)
            {
                m_DocumentPageSettings = pageSetupDialog.PageSettings;
            }
        }
开发者ID:Digresiv,项目名称:garminworkouts,代码行数:11,代码来源:PrintOptionsDialog.cs

示例10: button3_Click

 private void button3_Click(object sender, EventArgs e)
 {
     PageSetupDialog pageSetupDialog = new PageSetupDialog();
     pageSetupDialog.PageSettings = pgSettings;
     pageSetupDialog.PrinterSettings = prtSettings;
     pageSetupDialog.AllowOrientation = true;
     pageSetupDialog.AllowMargins = true;
     pageSetupDialog.ShowDialog();
     pd.PrinterSettings = prtSettings;
     pd.DefaultPageSettings = pgSettings;
 }
开发者ID:vmykh,项目名称:printer_labs,代码行数:11,代码来源:Form1.cs

示例11: TestPrint

        public void TestPrint()
        {
            PrintDocument document = new PrintDocument();
            document.PrintPage += new PrintPageEventHandler(Document_PrintPage);
            PageSetupDialog setup_dialog = new PageSetupDialog();
            setup_dialog.Document = document;
            setup_dialog.ShowDialog();

            PrintPreviewDialog preview_dialog = new PrintPreviewDialog();
            preview_dialog.Document = document;
            //document.DefaultPageSettings.Landscape = true;
            preview_dialog.ShowDialog();
        }
开发者ID:linghuyong,项目名称:DeckManager,代码行数:13,代码来源:TestLogic.cs

示例12: EditPrintSettings

        // Edit the print settings.
        public void EditPrintSettings()
        {
            // Show the page setup dialog
            PageSetupDialog pageSetupDialog = new PageSetupDialog();
            pageSetupDialog.PageSettings = _pageSettings;
            pageSetupDialog.PrinterSettings = _printerSettings;
            pageSetupDialog.ShowNetwork = false;

            if (pageSetupDialog.ShowDialog() == DialogResult.OK)
            {
                _pageSettings = pageSetupDialog.PageSettings;
                _printerSettings = pageSetupDialog.PrinterSettings;
            }
        }
开发者ID:KindDragon,项目名称:ICSharpCode.TextEditor.V4,代码行数:15,代码来源:PrintEngine.cs

示例13: PageSetupDialog

 void IPrintService.ConfigurePrintSettings()
 {
     PageSetupDialog dialog = new PageSetupDialog();
     dialog.PageSettings = this.PageSettings;
     dialog.PrinterSettings = this.PageSettings.PrinterSettings;
     dialog.ShowHelp = false;
     try
     {
         dialog.ShowDialog();
     }
     catch (Exception exception)
     {
         MessageBox.Show("Unable to open print settings.\n\nDetails:\n" + exception.Message, "Print Setttings");
     }
 }
开发者ID:ikvm,项目名称:webmatrix,代码行数:15,代码来源:PrintService.cs

示例14: btn_PageSetup_Click

 private void btn_PageSetup_Click(object sender, EventArgs e)
 {
     try
     {
         PageSetupDialog psetup = new PageSetupDialog();
         if (this.m_PageSetting == null)
             this.m_PageSetting = new PageSettings();
         psetup.PageSettings = this.m_PageSetting;
         psetup.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:15,代码来源:Form1.cs

示例15: pageSteToolStripMenuItem_Click

        /// <summary>
        /// 页面设置事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void pageSteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                PageSetupDialog setupDialog = new PageSetupDialog();
                if (storedPageSettings == null)
                    storedPageSettings = new PageSettings();

                setupDialog.PageSettings = storedPageSettings;
                setupDialog.ShowDialog();
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
开发者ID:Vlanta,项目名称:CspBase,代码行数:21,代码来源:Form1.cs


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