Results 1 to 4 of 4

Thread: RichTextBox: PrintView and Printing

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Posts
    237

    Angry RichTextBox: PrintView and Printing

    Dear All,

    I want to implement printview and printing in my application(it is using RichTextBox.) Can you please guide.
    software engineer

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Posts
    237

    Angry Re: RichTextBox: PrintView and Printing

    Well... I searched for this and got the idea that I should use PrintDialog and PrintDocument controls. I was also able to get some piece of code from web:


    printDialog1.Document = printDocument1;

    if (this.printDialog1.ShowDialog() == DialogResult.OK)
    {

    this.printDocument1.DocumentName = this.txtEditor.Text;
    this.printDocument1.Print();
    }

    Problem:

    I am not sure what should I use in place of "this.txtEditor.Text". Currently it prints a blank page. I also tried to use the name of RichTextBox control "txtEditor", but same result.

    Can anyone guide in this regard?
    software engineer

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: RichTextBox: PrintView and Printing

    I ain't to sure if your issue has been resolved but here is a link showing the easy way to printing and print previewing in C#

    Code Project - Simple Printing

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: RichTextBox: PrintView and Printing

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width