Tag Archives: textbox press enter

Disable the ‘Beep’ in Textbox when pressing the ‘Enter’ Key in VB.NET

Click Star to Rate Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

This will disable that ‘Beep’ when you press the ‘Enter’ key in a Textbox control. You want to put in your textbox controls _Keypress event. For example Textbox1_KeyPress


        'put this code in the TextBox_KeyPress event of your Textbox.
        'You can use the 'Carriage Return Character' constant: 'vbCr'
        'as the KeyChar to check or you can use the constant as the KeyChar.
        If e.KeyChar = vbCr Then

            e.Handled = True

        End If