Exemple #1
0
        /* File Print Preview */
        private void menuFilePrintPreview_Click(object sender, EventArgs e)
        {
            if (this.tabControl.TabCount <= 0) return;
            RichTextBox rtb = (RichTextBox)this.tabControl.SelectedTab.Controls[0];
            RichTextBoxDocument document = new RichTextBoxDocument(rtb);

            dialogPrintPreview.Document = document;
            dialogPrintPreview.ShowDialog();
        }
Exemple #2
0
        /* File Print */
        private void menuFilePrint_Click(object sender, EventArgs e)
        {
            if (this.tabControl.TabCount <= 0) return;
            RichTextBox rtb = (RichTextBox)this.tabControl.SelectedTab.Controls[0];
            RichTextBoxDocument document = new RichTextBoxDocument(rtb);

            dialogPrint.Document = document;
            if (dialogPrint.ShowDialog() == DialogResult.OK)
            {
                document.Print();
            }
        }
Exemple #3
0
        /* File Page Setup */
        private void menuFilePageSetup_Click(object sender, EventArgs e)
        {
            if (this.tabControl.TabCount <= 0) return;
            RichTextBox rtb = (RichTextBox)this.tabControl.SelectedTab.Controls[0];
            RichTextBoxDocument document = new RichTextBoxDocument(rtb);

            dialogPageSetup.Document = document;
            dialogPageSetup.PageSettings = new System.Drawing.Printing.PageSettings();
            dialogPageSetup.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
            dialogPageSetup.ShowDialog();
        }