please give me the solution to clear the contents of textBox using escape key.
Clear textBox value using escape Key
Sir, Please help me regarding Escape button and textBox.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Terrance CPosted May 14, 2013, 8:01 AM
private void TextBox_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
textbox1.Clear();
}
else
{
e.handled = true;
}
}
Jay SPosted May 14, 2013, 7:44 AM
textbox1.text = string.empty
}
}