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