Hello. This function has many applications. I have a TextBox control. How to display keys that the user pressed. For example pressed CTRL and z in the TextBox control should appear "Ctrl + Z"? It's WPF application. Thanks.
Now i'm trying like this:
private void txtHotKey_PreviewKeyUp(object sender, KeyEventArgs e)
{
txtHotKey.Text += e.Key.ToString();
txtHotKey.Text += "+";
e.Handled = true;
}
Now if I pressed Ctrl and Z in the textbox appear "Ctrl+Z+". Then press Ctrl and A. Will be "Ctrl+Z+Ctrl+A+". It's wrong.