I have a problem to how to catch which key is pressed. This is my code, but i cant get what key was pressed. I'm using KeyEventArgs for declaration of new variable and then comparing it.
private void textBox2_TextChanged(object sender, EventArgs e)
{
KeyEventArgs k = null;
if (e is KeyEventArgs)
{
k = (KeyEventArgs)e;
}
if (k.KeyCode == Keys.Enter)
{
// do something here
}
}