Textbox Enter-key Beep

  • Thread starter Thread starter moondaddy
  • Start date Start date
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.
 
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
 
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
 
Back
Top