Link to home
Start Free TrialLog in
Avatar of beef137
beef137

asked on

Making "donk" sound when pressing enter

I'm using Visual Studio 2008 and I have textboxes on a form. When I press "enter" on this form it performs a search which fills a datagridview. After the operation is complete it makes a "donk" sound. How can I get the "donk" sound to go away when you press enter while the active control is a textbox?
Avatar of Frosty555
Frosty555
Flag of Canada image

I don't have VS2008 on hand, but go to Control Panel->Sounds and audio devices->Sounds tab and see if visual studio has a section in the list of windows sounds. If it does you can customize / disable the sounds in that list.
Avatar of beef137
beef137

ASKER

Frosty,

Thanks for the response. But my compiled application makes this sound. Not just when Visual Studio is running.
What event is responding to the "Enter" on the form?

Click event of the "accept" button?  Enter event of a textbox?
Avatar of beef137

ASKER

Private Sub SearchForm_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown

        If TypeOf Me.ActiveControl Is TextBox And e.KeyCode = Keys.Return Then
            SearchList()
        Else
            If TypeOf Me.ActiveControl Is DataGridView And e.KeyCode = Keys.Return Then
                OpenRecordSearch()
            End If
        End If

    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Clif
Clif
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial