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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Print the contents of an entire form

Print the contents of an entire form

Scheduled Pinned Locked Moved C#
question
4 Posts 2 Posters 1 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.
  • R Offline
    R Offline
    rikkemus
    wrote on last edited by
    #1

    Is it possible to print your entire form, with pictureboxes etc. I know you can use ControlPaint.Button etc to print my controls, but what if i had an entire form(not mainmenu and the things above) i wished to output to my printer?

    R 1 Reply Last reply
    0
    • R rikkemus

      Is it possible to print your entire form, with pictureboxes etc. I know you can use ControlPaint.Button etc to print my controls, but what if i had an entire form(not mainmenu and the things above) i wished to output to my printer?

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      Have you tried searching for print form[^]?

      R 1 Reply Last reply
      0
      • R Robert Rohde

        Have you tried searching for print form[^]?

        R Offline
        R Offline
        rikkemus
        wrote on last edited by
        #3

        Yes but those examples doesnt really do what i want, it has shortcomings when it comes to pictureboxes etc. In old vb6.0 you could print an entire form, with PrintForm. MSDN makes an example where they Screenshot the memory for the drawed form(since printform isnt in .net), but if some part of the form is outside the screen, it cant dump that. To me it sound logically, that you should be able to extract the drawed form somehow, even though it isnt on screen. Perhaps build a shadow of it in memory? and then memcpy that to the printerdocument.

        R 1 Reply Last reply
        0
        • R rikkemus

          Yes but those examples doesnt really do what i want, it has shortcomings when it comes to pictureboxes etc. In old vb6.0 you could print an entire form, with PrintForm. MSDN makes an example where they Screenshot the memory for the drawed form(since printform isnt in .net), but if some part of the form is outside the screen, it cant dump that. To me it sound logically, that you should be able to extract the drawed form somehow, even though it isnt on screen. Perhaps build a shadow of it in memory? and then memcpy that to the printerdocument.

          R Offline
          R Offline
          Robert Rohde
          wrote on last edited by
          #4

          You could probably have a look at the WM_PRINT and WM_PRINTCLIENT apis. If I remember correctly they nearly did the same thing as WM_PAINT did with the difference not having an invalid area (i.e. outside of the screen).

          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