Saturday, November 23, 2013

send keystroke in WPF

lb.Focus();

InputManager.Current.ProcessInput(
  new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Down)
  {
    RoutedEvent = Keyboard.KeyDownEvent
  }
);

No comments: