I want to detect Escape on a field in C# to add '_', I test this following code e.KeyCode == Keys.Escape but not working. Have you an idea ?
private void tbxLibelle_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
tbxNomimage.Text += '_';
}
else
{
tbxNomimage.Text = tbxLibelle.Text;
}
}