http://social.msdn.microsoft.com/forums/en-US/wpf/thread/4c404667-e766-4e5c-9116-a78febbc29d8
This is correct behaviour. Buttons respond to the enter key being pressed, not released, so the message box is dismissed as soon as the key is pressed and its parent form activated again. So, the parent form is activated by the time the key is release and it gets the key up message.
The incorrect behaviour in this case is your application showing a message box on a key up. It should either show it on key down, or wait for a full key down then key up cycle to display it.
解决方法,使用keydown方法替代,或者使用一组完整的keydown和keyup事件处理
549

被折叠的 条评论
为什么被折叠?



