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. PrintPreviewDialog and capturing keystroke events

PrintPreviewDialog and capturing keystroke events

Scheduled Pinned Locked Moved C#
helpquestion
2 Posts 1 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.
  • P Offline
    P Offline
    paas
    wrote on last edited by
    #1

    I am using the PrintPreviewDialog to display reports created via a class that inherits the PrintDocument. I have no problem displaying the reports, but I would also like to be able to capture any keystrokes the user makes while the preview dialog has the focus; in particular I want to be able to capture the escape key. Unfortunately even though I have added handlers for the PreviewKeyDown, KeyDown, KeyPress, and KeyUp events of the print preview dialog, my class still does not capture any of the keystroke events in the print preview dialog. Does anyone know of a way I can capture keystroke events for the print preview dialog? Thank you...

    P 1 Reply Last reply
    0
    • P paas

      I am using the PrintPreviewDialog to display reports created via a class that inherits the PrintDocument. I have no problem displaying the reports, but I would also like to be able to capture any keystrokes the user makes while the preview dialog has the focus; in particular I want to be able to capture the escape key. Unfortunately even though I have added handlers for the PreviewKeyDown, KeyDown, KeyPress, and KeyUp events of the print preview dialog, my class still does not capture any of the keystroke events in the print preview dialog. Does anyone know of a way I can capture keystroke events for the print preview dialog? Thank you...

      P Offline
      P Offline
      paas
      wrote on last edited by
      #2

      Well, I have an answer to my own question. If anyone is curious, I went ahead and created another class that inherits the PrintPreviewDialog, and by using that class to perform the preview functions I am able to capture keystrokes on the preview form, including escape, from within that class. I would prefer not to have to create another class but if that is what is needed, I will live.

      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