コード例 #1
0
ファイル: frmAllFiles.cs プロジェクト: yirenkyi55/RegistryApp
        private void Doc_PrintPage(object sender, PrintPageEventArgs e)
        {
            float         lineHeight = e.MarginBounds.Top;
            FilesDocument files      = (FilesDocument)sender;

            files.PrintFilesPage(e);
        }
コード例 #2
0
ファイル: frmAllFiles.cs プロジェクト: yirenkyi55/RegistryApp
        private void btnPrint_Click(object sender, EventArgs e)
        {
            printList = fileData.SelectAllFiles().ToList();
            //Create the printdocument and attach an event handler
            PrintDocument doc = new FilesDocument(printList);

            doc.PrintPage += Doc_PrintPage;
            PrintDialog dlgSettings = new PrintDialog();

            dlgSettings.Document = doc;
            if (dlgSettings.ShowDialog() == DialogResult.OK)
            {
                doc.Print();
                Logger.WriteToFile(Logger.FullName, "printed a file");
            }
        }