當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。