I have a form with some labels and two buttons, buttons are Yes and No.
For some reason I cannot get whether the user has pressed y or n keys on the form. If I use the same event for a textbox for example it works just fine.
private void Form2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Y)
{
btnYes.PerformClick();
}
}
Seems like that event never fires. Why is that?