Apr 24
Typically when you press the Enter key while typing in a TextBox control, you will hear the computer beep.
To prevent this beep, handle the Enter key in the KeyPress event, and set the Handled property to true. For example:
void TextBox_KeyPress( object sender, KeyPressEventArgs e ) { switch (e.KeyChar) { case '\r': // perform necessary action e.Handled = true; break; } }
Copyright © 2007-8 Tiwebb Ltd. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without explicit permission from Tiwebb Ltd.

