|
-
Jun 2nd, 2006, 10:11 PM
#1
Thread Starter
Junior Member
[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!
-
Jun 2nd, 2006, 10:26 PM
#2
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?
-
Jun 2nd, 2006, 10:32 PM
#3
Thread Starter
Junior Member
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!
-
Jun 18th, 2006, 08:07 PM
#4
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|