Results 1 to 6 of 6

Thread: How do I print a rich text box?

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    How do I print a rich text box?

    I have a PrintDialog and a PrintDocument, in conjunction with a Rich Text Box. How the hell would i get the Rich Text Box to print?

    I've searched the forum and the only things I've seen are pages and pages of code just to PRINT! I figured .NET would of had a simple function or something..

  2. #2

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Ok I got this so far:
    VB Code:
    1. Private Sub PrintDocument_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument.PrintPage
    2.         e.Graphics.DrawString(txtBoxChild.Text.ToString(), New Font("Vernada", 11, FontStyle.Regular), Brushes.Black, 4, 7)
    3.     End Sub

    This works perfect except for 1 problem... if I put too much text on 1 line, it cuts that text off. How can I force it to word wrap when printing so nothing gets cut off?

  3. #3

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Sorry to top this question so much, but can I make it so a red line appears at the right margine line? This way people will know when the text is going to get cut off.

    I know I can set the right margin to something so no one can go past it, but the reason for this program, people will probably go past it all the time.

    If anyone has used Dev Shed C++ IDE, you'll know what i'm talking about

  4. #4

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    No one?

    I've been trying to figure it out but I'm not sure how I would craete a line... hmm I'm sure I could like display a bar or something at the point but then... the users would have to delete it and I want it to be a small background line...

    hmm...

  5. #5
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    why don't you save the text as a document and print the document?

  6. #6

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by RichardAtherton
    why don't you save the text as a document and print the document?

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