Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turn Bell OFF in VB 1

Status
Not open for further replies.

pianoman

Programmer
Oct 2, 2000
4
US
In all my active X controls I wrote and any program with a text box when I end the input with an enter key, I get a bell.(beep)... How can I turn it off. Only documentation I found was for FOx Pro (SET BELL OFF). That does not work in VB. Get an error. Got to be an answer I am missing.
Thanks to anyone for help.
 
Hi Pianoman,

What you want to do, is this, go to another control or is siply remove the ding out of th enter key?

To remove the ding, you can simply use this code.

Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii = vbKeyReturn) Then KeyAscii = 0
End Sub

If you want to go to another control with the enter key you can use this code

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{tab}"
KeyAscii = 0
End If
End Sub

Hope this is what you are looking for
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top