Exemple #1
0
        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