Textbox Enter-key Beep

M

moondaddy

I'm writing a winforms app in vb.net 1.1 and have an issue when users click
the enter key on a textbox. It make a beep sound as if an error had
occurred. how can I turn off the beep sound? I'm actually trapping the key
up event and when the user uses the enter key I do something. Any good
advise?

I saw some other posts on this but they had already expired and were no
longer on the server.

Thanks.
 
T

Tim Wilson

One way to do this is to just "eat" the enter...

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = ControlChars.Cr Then
e.Handled = True
End If
End Sub
 
M

moondaddy

Thanks! That worked very nice.

--
(e-mail address removed)
Tim Wilson said:
One way to do this is to just "eat" the enter...

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = ControlChars.Cr Then
e.Handled = True
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top