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. Print Page Count

Print Page Count

Scheduled Pinned Locked Moved C#
question
6 Posts 3 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.
  • G Offline
    G Offline
    Gareth H
    wrote on last edited by
    #1

    Hi, How can i find out how many pages there are to print?, since there isnt a property in the PrintPreviewControl for it, but when you create the PrintPreviewControl, a small dialog pops up and counts through the pages which you can preview, thus i presume you must be able to access that event/method some how. Any ideas? Regards, Gareth.

    J S 2 Replies Last reply
    0
    • G Gareth H

      Hi, How can i find out how many pages there are to print?, since there isnt a property in the PrintPreviewControl for it, but when you create the PrintPreviewControl, a small dialog pops up and counts through the pages which you can preview, thus i presume you must be able to access that event/method some how. Any ideas? Regards, Gareth.

      J Offline
      J Offline
      Jabeerbe
      wrote on last edited by
      #2

      How do you Print the Data. I need the Sample Code.

      Regards, A Jabeer Ali

      1 Reply Last reply
      0
      • G Gareth H

        Hi, How can i find out how many pages there are to print?, since there isnt a property in the PrintPreviewControl for it, but when you create the PrintPreviewControl, a small dialog pops up and counts through the pages which you can preview, thus i presume you must be able to access that event/method some how. Any ideas? Regards, Gareth.

        S Offline
        S Offline
        Seishin
        wrote on last edited by
        #3

        gareth111 wrote:

        pops up and counts through the pages which you can preview

        the box is like "trackBar".. it shows you the progres of painting content to the paper.. in your PrintPage event of printDocument object use some int as a counter.. set it to 0 in BeginPaint event

        life is study!!!

        G 1 Reply Last reply
        0
        • S Seishin

          gareth111 wrote:

          pops up and counts through the pages which you can preview

          the box is like "trackBar".. it shows you the progres of painting content to the paper.. in your PrintPage event of printDocument object use some int as a counter.. set it to 0 in BeginPaint event

          life is study!!!

          G Offline
          G Offline
          Gareth H
          wrote on last edited by
          #4

          Seishin#: The PrintPage event is fired when your actually printing the data, i want to know BEFORE i print it, so i can display to the user the number of pages. eg Page 1 of 20. Regards, Gareth.

          S 1 Reply Last reply
          0
          • G Gareth H

            Seishin#: The PrintPage event is fired when your actually printing the data, i want to know BEFORE i print it, so i can display to the user the number of pages. eg Page 1 of 20. Regards, Gareth.

            S Offline
            S Offline
            Seishin
            wrote on last edited by
            #5

            gareth111 wrote:

            PrintPage event is fired when your actually printing the data

            nope.. don't confuse PrintPage event with Print method.. when you handle PrintPage event you implement the actual look of the page as it will be printed when you call Print method.. PrintPage event is fired for each page that will be printed and thats why you can put in it some pageCounter++ line to count pages.. when you open print preview it is generated with PrintPage event.

            life is study!!!

            G 1 Reply Last reply
            0
            • S Seishin

              gareth111 wrote:

              PrintPage event is fired when your actually printing the data

              nope.. don't confuse PrintPage event with Print method.. when you handle PrintPage event you implement the actual look of the page as it will be printed when you call Print method.. PrintPage event is fired for each page that will be printed and thats why you can put in it some pageCounter++ line to count pages.. when you open print preview it is generated with PrintPage event.

              life is study!!!

              G Offline
              G Offline
              Gareth H
              wrote on last edited by
              #6

              Seishin#: Sorry, you were correct. The reason i was getting confused was i had some debugging in the PrintPage event which wasnt been displayed when the preview control was being created. Thus i thought the event wasnt the place i should be looking into. Cheers, Gareth.

              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