[RESOLVED] [2005] Disable beep when hitting Enter in vb.net
I've tried using:
in the keydown and keypress functions, but that doesn't work.
I've also researched it decently well and found this interesting thread:
Old Thread Here
However, nothing there seemed to work either!
Anyone know of a sure fire way to simply turn the beep off on single-line textboxes when the user presses enter?
Thanks!
Re: [2005] Disable beep when hitting Enter in vb.net
Is VB 2005 really so different that this won't work?
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(13) Then
e.Handled = True
End If
End Sub
If you just use
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
e.Handled = True
End Sub
is it so, that you can't enter anything but you still hear the beep when you press enter?
Re: [2005] Disable beep when hitting Enter in vb.net
oh wow. you are right.
I was so close, yet so far away.
I used it alone in the keypress which was disallowing everything so I immediately stopped and went onto the next idea without realizing that if I did:
VB Code:
If e.KeyChar = Chr(13) Then
e.Handled = True
End If
then things work!
Thanks a lot!
Re: [RESOLVED] [2005] Disable beep when hitting Enter in vb.net
Thanks so much for having this answer ready for me! Only problem is that I couldn't find this page until I came directly to vbforums.com! Down with Google! Why wouldn't this page (which SHOULD exactly match my search terms) show up? Guess I'll be coming straight here from now on.