private void SettingsPrint(bool preview, bool showPrintDialog) { string textToPrint = string.Empty; _printer.Title = this.Text; _printer.ShowPageNumbers = true; Font fnt = new System.Drawing.Font("Lucida Console", (float)10.0); _printer.Font = fnt; textToPrint = _textFormatter.FormatFormTextToString(this); if (textToPrint == string.Empty) { textToPrint = "Nothing to print."; } _printer.TextToPrint = textToPrint; if (preview) { _printer.ShowPrintPreview(); } else { if (showPrintDialog) { _printer.ShowPrintDialog(); } else { _printer.Print(); } } } //end method
private void FilePrint(bool preview, bool showPrintDialog) { _printer.Title = this.Text; _printer.ShowPageNumbers = true; _printer.Font = this.Font; _printer.TextToPrint = "Testing the print function.\nThis is the second line."; if (preview) { _printer.ShowPrintPreview(); } else { if (showPrintDialog) { _printer.ShowPrintDialog(); } else { _printer.Print(); } } }