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?
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?
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
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?
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Not with version 1.x of the Framework, however with version 2.0 this isn't a problem.