Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. RichTextBox printing???

RichTextBox printing???

Scheduled Pinned Locked Moved C#
tutorialjsonquestion
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nogola
    wrote on last edited by
    #1

    How to print the text from a richtextbox, but with the fonts it's written in it. For example in a RTB i have a part wich is BOLD and the rest is REGULAR. How to print it as it is, and not all the text in BOLD or REGULAR ???:confused::confused::confused: -- modified at 13:06 Sunday 12th March, 2006

    E 1 Reply Last reply
    0
    • N nogola

      How to print the text from a richtextbox, but with the fonts it's written in it. For example in a RTB i have a part wich is BOLD and the rest is REGULAR. How to print it as it is, and not all the text in BOLD or REGULAR ???:confused::confused::confused: -- modified at 13:06 Sunday 12th March, 2006

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      Take a look at this Ed

      N 1 Reply Last reply
      0
      • E Ed Poore

        Take a look at this Ed

        N Offline
        N Offline
        nogola
        wrote on last edited by
        #3

        No use of that, i want to print it anywhere on the paper, and not only that... This example alows only to print the richtextbox text on a paper and nothing more... if you understand what i mean...

        E 1 Reply Last reply
        0
        • N nogola

          No use of that, i want to print it anywhere on the paper, and not only that... This example alows only to print the richtextbox text on a paper and nothing more... if you understand what i mean...

          E Offline
          E Offline
          Ed Poore
          wrote on last edited by
          #4

          That article is an example so that you can modify it to your needs.

          • To print anywhere on the page just change rectToPrint to the rectangle you need to print onto.
          • If again, I understand you correctly you want to be able to print onto Forms as well as the printer? To do this then just redefine the Print method to accept a Graphics object instead of PrintPageEventArgs, then draw using this graphics and not the printer graphics, you can then pass a form's graphics canvas and print the contents of the richtextbox onto that form.

          Ed

          N 1 Reply Last reply
          0
          • E Ed Poore

            That article is an example so that you can modify it to your needs.

            • To print anywhere on the page just change rectToPrint to the rectangle you need to print onto.
            • If again, I understand you correctly you want to be able to print onto Forms as well as the printer? To do this then just redefine the Print method to accept a Graphics object instead of PrintPageEventArgs, then draw using this graphics and not the printer graphics, you can then pass a form's graphics canvas and print the contents of the richtextbox onto that form.

            Ed

            N Offline
            N Offline
            nogola
            wrote on last edited by
            #5

            How to change te rectToPrint??? I dont won't it to be constant. I want it to be variable

            E 1 Reply Last reply
            0
            • N nogola

              How to change te rectToPrint??? I dont won't it to be constant. I want it to be variable

              E Offline
              E Offline
              Ed Poore
              wrote on last edited by
              #6

              It is a variable :mad: Ed

              N 1 Reply Last reply
              0
              • E Ed Poore

                It is a variable :mad: Ed

                N Offline
                N Offline
                nogola
                wrote on last edited by
                #7

                I cant change it, it's not public, and i can't make it public, so it is a variable but it's not variable...

                E 1 Reply Last reply
                0
                • N nogola

                  I cant change it, it's not public, and i can't make it public, so it is a variable but it's not variable...

                  E Offline
                  E Offline
                  Ed Poore
                  wrote on last edited by
                  #8

                  nogola wrote:

                  so it is a variable but it's not variable...

                  :wtf: :confused: :omg: Just add it as a parameter in the method declaration, then when you call the function you specify the rectangle where you want to draw it. :| Ed

                  N 1 Reply Last reply
                  0
                  • E Ed Poore

                    nogola wrote:

                    so it is a variable but it's not variable...

                    :wtf: :confused: :omg: Just add it as a parameter in the method declaration, then when you call the function you specify the rectangle where you want to draw it. :| Ed

                    N Offline
                    N Offline
                    nogola
                    wrote on last edited by
                    #9

                    Ok, tnx... I tried it before on my laptop several times, and it didnt work... Now I tried on my PC and it did... Sorry for bothering...

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups