How is "Esc" key handled in WPF Window?

Posted by Markus2k on Stack Overflow See other posts from Stack Overflow or by Markus2k
Published on 2010-04-19T02:18:15Z Indexed on 2010/04/19 2:23 UTC
Read the original article Hit count: 650

Filed under:
|
|

I want the Escape key to close my WPF window. However if there is a control that can consume that Escape key, I don't want to close the Window. There are multiple solutions on how to close the WPF Window when ESC key is pressed. eg. http://stackoverflow.com/questions/419596/how-does-the-wpf-button-iscancel-property-work

However this solution closes the Window, without regard to if there is an active control that can consume the Escape key.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about window