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


C# PrintDialog.Dispose方法代码示例

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


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

示例1: printare


//.........这里部分代码省略.........
                           }

                           // f_out.Write("\n");

                       }
                   }
               }

               if (IS.Length > 4)
               {
                   s = "IMUNOLOGIE SI SEROLOGIE\n";
                   f_out.Write(s);
                   for (i = 4; i < IS.Length; i++)
                   {
                       if (IS[i] != ';')
                       {
                           nr = nr * 10 + int.Parse(IS[i].ToString());
                       }
                       else
                       {
                           nr_crt++;
                           s = nr_crt.ToString() + "." + s3[nr].Substring(0, s3[nr].IndexOf(' ')) + "\n";
                           nr = 0;
                           f_out.Write(s);
                       }
                   }
               }

               if (ME.Length > 4)
               {
                   s = "MARKERI ENDOCRINI\n";
                   f_out.Write(s);
                   for (i = 4; i < ME.Length; i++)
                   {
                       if (ME[i] != ';')
                       {
                           nr = nr * 10 + int.Parse(ME[i].ToString());
                       }
                       else
                       {
                           nr_crt++;
                           s = nr_crt.ToString() + "." + s4[nr].Substring(0, s4[nr].IndexOf(' ')) + "\n";
                           nr = 0;
                           f_out.Write(s);
                       }
                   }
               }
               if (B.Length > 4)
               {
                   s = "BIOCHIMIE\n";
                   f_out.Write(s);
                   for (i = 4; i < B.Length; i++)
                   {
                       if (B[i] != ';')
                       {
                           nr = nr * 10 + int.Parse(B[i].ToString());
                       }
                       else
                       {
                           nr_crt++;
                           s = nr_crt.ToString() + "." + s2[nr].Substring(0, s2[nr].IndexOf(' ')) + "\n";
                           nr = 0;
                           f_out.Write(s);
                       }
                   }

               }
               }
               catch (IOException exc)
               {
               Console.WriteLine(exc.Message + "print");
               }
               f_out.Close();

               // Get the path that stores user documents.
               string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
               PrintDialog pd = new PrintDialog();
               System.Drawing.Printing.PrintDocument docToPrint = new System.Drawing.Printing.PrintDocument();
               docToPrint.DocumentName = "Print.doc";

               pd.Dispose();

               pd.Document = docToPrint;

               DialogResult result = pd.ShowDialog();

               // If the result is OK then print the document.
               if (result == DialogResult.OK)
               {
                   docToPrint.Print();
               }

               }
               catch (Exception exc)
               {

               Console.WriteLine(exc.Message.ToString());

               }
        }
开发者ID:evelinad,项目名称:MedLAB,代码行数:101,代码来源:Print.cs

示例2: printToolStripMenuItem_Click

        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PrintDocument printDocument = new PrintDocument();
            printDocument.PrintPage += PrintDocument_PrintPage;

            PrintDialog dialog = new PrintDialog();
            dialog.PrinterSettings = printDocument.PrinterSettings;

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                printDocument.Print();
            }
            dialog.Dispose();
        }
开发者ID:topikuure,项目名称:Timetable,代码行数:14,代码来源:MainForm.cs

示例3: Print

        private void Print()
        {
            PrintDialog printDialog = new PrintDialog();
            PrintDocument printImage = new PrintDocument();

            printImage.DocumentName = "Cropper Captured Image";
            printImage.PrintPage += OnPrintPage;

            printDialog.Document = printImage;

            DialogResult result = printDialog.ShowDialog();

            // Send print message
            try
            {
                if (result == DialogResult.OK)
                    printImage.Print();
            }
            catch (InvalidPrinterException)
            {
                ShowPrintError();
            }
            finally
            {
                printImage.Dispose();
                printDialog.Dispose();
            }
        }
开发者ID:pusp,项目名称:o2platform,代码行数:28,代码来源:PrinterOutput.cs

示例4: PrinterSetting

        public void PrinterSetting()
        {
            PrintDialog pDlg = new PrintDialog();
            PrintPreviewDialog ppDlg = new PrintPreviewDialog();
            try
            {
                //��������ֵ��PrinterSettings
                PrinterSettings ps = new PrinterSettings();

                //����ѡ��ҳ
                pDlg.AllowSomePages = true;

                //ָ����ӡ�ĵ�
                pDlg.Document = document;

                //��ʾ�Ի���
                DialogResult result = pDlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    //�����ӡ����
                    ps = pDlg.PrinterSettings;

                    ppDlg.Text = "��ӡԤ��";
                    ppDlg.WindowState = FormWindowState.Maximized;
                    ppDlg.PrintPreviewControl.Zoom = 1;
                    //ָ����ӡ�ĵ�
                    ppDlg.Document = document;
                    ppDlg.ShowDialog();
                }

            }
            catch (System.Drawing.Printing.InvalidPrinterException e)
            {
                MessageBox.Show("�����ڿ��������Ӵ�ӡ��!", "δ�ҵ���ӡ��");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "��ӡ����");
            }
            finally
            {
                pDlg.Dispose();
                pDlg = null;
                ppDlg.Dispose();
                ppDlg = null;
            }
        }
开发者ID:romanu6891,项目名称:fivemen,代码行数:47,代码来源:PrinterContent.cs


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