Sendkey in WPF

How to simulate a keystroke by code in WPF

I don’t want to use win32 SendInput .

I don’t need a Inter process message. I only need to send a key to the control who has the focus in the visual tree

Thanks.



Answer this question

Sendkey in WPF

  • Mr. Paoli

    Sorry, we don't have such a method.

    If you're just trying to set focus, you can call mycontrol.Focus().



  • Sendkey in WPF