Closing a PrintPreviewDialog with the escape key

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.
 
V

VJ

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
 
C

ClayB

Try overriding ProcessCmdKey and try catching the esc key there.

====================
Clay Burch
Syncfusion, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top