2

Inside the application there is an if statement. It checks a string variable kai if the variable equals to 1 i want it to react as if i pressed the right arrow on my keyboard. Can you help me with that? Thanks.

Kwstas
  • 129
  • 1
  • 1
  • 7

2 Answers2

1

Actually you might want to think about using Commands for that. If you think about what you want to achieve it is to trigger something after the Key-Press. If you use a Command for that you can directly trigger it without going via the programmatic key pressing stuff. Also you can still trigger the command via a keypress (InputGesture).

You can find out more about Commands here: http://msdn.microsoft.com/en-us/library/system.windows.input.icommand.aspx

Gope
  • 1,672
  • 1
  • 13
  • 19
0

maybe like this:

SendKey.Send({rigth});

set focus to the control you want to input before. And you ave to declare

Using System.Windows.Form
CB.
  • 58,865
  • 9
  • 159
  • 159