Basically, I want to be able to trigger an event when the ENTER key is pressed. I tried this already:
private void input_KeyDown(object sender, KeyEventArgs e)
{
if (e.Equals("{ENTER}"))
{
MessageBox.Show("Pressed enter.");
}
}
But the MessageBox never shows up. How can I do this?
Give this a shot...
private void input_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyData == Keys.Enter)
{
MessageBox.Show("Pressed enter.");
}
}