I want to send a string to textbox using a button click on wpf... Does anyone knows how to use inputmanager because the code below wont work? I use the code to test to send a delete or a letter a to a textbox...
public static class SendKeys
{
/// <summary>
/// Sends the specified key.
/// </summary>
/// <param name="key">The key.</param>
public static void Send(Key key)
{
if (Keyboard.PrimaryDevice != null)
{
if (Keyboard.PrimaryDevice.ActiveSource != null)
{
var e1 = new KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Down) {RoutedEvent = Keyboard.KeyDownEvent};
InputManager.Current.ProcessInput(e1);
}
}
}
}