I have a simple form by which I take input:
12 buttons, 1 text box (disabled and read-only)

this is what i do for input input
Login_KeyDown () is a common method. I call for all KeyDown each component of the user interface and the form itself.
private void Login_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
Application.Exit();
}
else if (e.KeyCode == Keys.NumPad9 || e.KeyCode == Keys.D9)
{
button3.BackgroundImage = Properties.Resources.button_hover;
button3.ForeColor = Color.White;
pin.Text = pin.Text + "9";
}
else if (e.KeyCode == Keys.Back)
{
button11.BackgroundImage = Properties.Resources.button_hover;
button11.ForeColor = Color.White;
if (pin.Text.Length > 0)
pin.Text = pin.Text.Substring(0, pin.Text.Length - 1);
}
else if (e.KeyCode == Keys.Enter)
{
MessageBox.Show(pin.Text);
}
}
This code works fine when starting the application, but after I clicked on a component, the rest of the code works fine, but the "Enter Key Condition" does not work.
I assume that the "Enter Key Condition" does not work for user interface components or something like that.
" , KeyPressEventArgs, KeyChar == 13, .
, ?
p.s.
, 100% KBoard.