Keys is an enumeration and does not contain the SendKey method. However, you can do something like this:
SendKeys.Send(Keys.A.ToString());
You can also send multiple keys using string concatenation:
SendKeys.Send(Keys.A.ToString() + Keys.B.ToString());
Similary, this code works for me:
private void departmentList_KeyDown(object sender, KeyEventArgs e) { Keys key = e.KeyCode; SendKeys.Send(key.ToString()); }
Also check out this question: SendKeys :: Send, going berserk . What is your goal, if I may ask?
source share