Monday, July 7, 2008

Sending key presses to controls in WPF

The easiest way is to do the following:

KeyEventArgs keyEventArgs = new KeyEventArgs(e.KeyboardDevice, e.InputSource, e.Timestamp, Key.Right);
keyEventArgs.RoutedEvent = e.RoutedEvent;
.RaiseEvent(keyEventArgs);

No comments: