#region - btnPrintRpt_Click - Start ///////////////////////////////////////////////////////////////////////// // // btnPrintRpt_Click // ///////////////////////////////////////////////////////////////////////// private void btnPrintRpt_Click(object sender, EventArgs e) { try { PrintDialog printDlg = new PrintDialog(); PrintDocument printDoc = new PrintDocument(); printDoc.DocumentName = @"c:\MyData\Textfile.txt"; printDlg.Document = printDoc; printDlg.AllowSelection = true; printDlg.AllowSomePages = true; if (printDlg.ShowDialog() == DialogResult.OK) printDoc.Print(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "btnPrintRpt_Click", MessageBoxButtons.OK); } } #endregion - btnPrintRpt_Click - End
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)