You can prevent the beep when the enter key is pressed in a TextBox by deriving the TextBox and overriding OnKeyPress.
[C#]
public class CustomTextBox : TextBox
{
protected override void OnKeyPress( KeyPressEventArgs e )
{
if ( e.KeyChar == (char) 13 )
e.Handled = true;
else
base.OnKeyPress( e );
}
}
[Visual Basic]
Public Class CustomTextBox
Inherits TextBox
Protected Overrides Sub OnKeyPress(ByVal e As KeyPressEventArgs)
If e.KeyChar = CChar(13) Then
e.Handled = True
Else
MyBase.OnKeyPress(e)
End If
End Sub
End Class
Contributed from George Shepherd's Windows Forms FAQ