You need to set KeyPreview
Property of your Form to True
.
and then write a KeyDown
Event to Handle Enter
Key on Form
as Below:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
button_Valider_Click(sender,e);
}
}