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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent the "bip" sound after pressing ENTER? 1

Status
Not open for further replies.

todd666

IS-IT--Management
Dec 3, 2001
61
CA
Hi,

I have a programm with a search function. I can click on the button "Search" or press "Enter" to do "Search".

Each time I press "Enter", a "bip" sound is made. How can I prevent it?

Here is the code:
Code:
Private Sub Text3_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
    Recherche_Click
  End If
End Sub
 
If you want to have a certain buttons event fired when the user presses enter then I would set the Default property of the Button to true. I believe that doing this also takes care of the beep
 
Another question?

I have a button for closing my form. (I disabled the right X in the corner.)

I would like to add a sound to play when I click on it?
Is it possible and how?
 
Another way to stop the beep, if you dont want to use the default action.

Code:
Private Sub Text3_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
    keyascii=0
    Recherche_Click
  End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top