The text control needs to be single line, and I've captured the KeyPress event for when Enter is pressed. This works fine, but the control beeps whenever Enter is pressed, even if I capture KeyDown as well. Is there a way to stop this behavior?
Printable View
The text control needs to be single line, and I've captured the KeyPress event for when Enter is pressed. This works fine, but the control beeps whenever Enter is pressed, even if I capture KeyDown as well. Is there a way to stop this behavior?
Try this.
Code:protected override bool ProcessDialogKey(System.Windows.Forms.Keys keyData)
{
if (keyData == System.Windows.Forms.Keys.Enter)
return true;
return base.ProcessDialogKey(keyData);
}
Works great, thanks. Can it be done without overriding a function?
Not with version 1.x of the Framework, however with version 2.0 this isn't a problem.