470,591 Members | 1,555 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Closing a PrintPreviewDialog with the escape key

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.

Mar 13 '07 #1
2 1929
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

<pe*************@gmail.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
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.

Mar 13 '07 #2
Try overriding ProcessCmdKey and try catching the esc key there.

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

Mar 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Michael A. Covington | last post: by
reply views Thread by Harry J. Smith | last post: by
1 post views Thread by Jack E. Hardie | last post: by
1 post views Thread by jacopomeucci | last post: by
2 posts views Thread by Richard MSL | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.