Closing a PrintPreviewDialog with the escape key

  • Thread starter Thread starter peter.mcclymont
  • Start date Start date
P

peter.mcclymont

Hi There,

I am trying to add the option to close a PrintPreviewDialog using the
escape key.

Firstly is there an option when creating a PrintPreviewDialog that
would allow me to do that?

I have tried to inherit the PrintPreviewDialog and override the key
events. That didn't work.

I also tried to catch the key events using a deligate. That also
didn't work

Thanks,

Peter.
 
Well you could try to send a WM_Close message to the window on Esc key
press, is that what you tried? There seems to be a override for
ProcessKeyMessage, did you try that? There is also a ProcessKeyDialog(), for
override. One of them should do it. I feel bad for suggesting Trial/Error
methods, but if you have tried all of it, I will check my team that wrote
our printing compnent, see if we can help you better..Our app seems to close
it on cancel, I just don't have code now to see what it does.

VJ
 
Try overriding ProcessCmdKey and try catching the esc key there.

====================
Clay Burch
Syncfusion, Inc.
 
Back
Top