Hi when I do in one of my user controls in a WPF application, this.KeyUp += new System.Windows.Input.KeyEventHandler(MultipleControlViewer_KeyUp); or this.KeyDown += new System.Windows.Input.KeyEventHandler(MultipleControlViewer_KeyUp); or this.AddHandler(Window.KeyDownEvent, new System.Windows.Input.KeyEventHandler(MultipleControlViewer_KeyUp), true); I can never get the key events to fire when pusing a key on the keyboard. Would anyone know why? Thanks
A:
the event is probably being handled before you can get to it, if any handlers mark the KeyEventArgs e.Handled = true; you wont get the notification, try using the PreviewKeyDown or PreviewKeyUp events and see if you have more luck.
Aran Mulholland
2009-12-09 03:35:23
A:
try this answer http://stackoverflow.com/questions/347724/how-can-i-capture-keydown-event-on-a-wpf-page-or-usercontrol-object
MrTelly
2009-12-09 03:37:07