Live Chat Icon For mobile
Live Chat Icon

How to get rid of the gong sound when enter is hit in textbox?

Platform: WinForms| Category: TextBox

Subclass from TextBox, override ProcessDialogKey and do the following:


protected override bool ProcessDialogKey(Keys keyData)
{
	if(keyData == Keys.Return)
	{
		return true;
	}
	else if(keyData == Keys.Escape)
	{
		return true;
	}
	else
		return base.ProcessDialogKey(keyData);
}

The idea is to prevent the base class from processing certain keys.

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.