Is there a way to start a method in C# if a key is pressed? For example, Esc?
use the OnKeyPress Event of your textbox and in the event
if(e.KeyCode==Keys.Escape) { yourTextBox.Text = string.Empty; }
2.1m questions
2.1m answers
60 comments
57.0k users