I know the question has been asked and answered many times, but what if none of the answers work? I'm using Visual Studio 2017 to rewrite a vb6 app that catches the key combination "ctrl+enter" to load a dialogue. I catch the key combination just fine from a textbox called CourtName, but can't get rid of the annoying "ding" that goes with it. I have googled for many hours but everywhere the answer is to use e.Handled and/or e.SuppressKeyPress, which I have done without success. Here is my code:
Private Sub CourtName_KeyDown(sender As Object, e As KeyEventArgs) Handles CourtName.KeyDown
If e.KeyCode = Keys.Enter AndAlso e.Control Then
e.Handled = True
e.SuppressKeyPress = True
CourtsBtn.PerformClick()
End If
End Sub
The ding still persists, no matter whether the e.Handled and e.SuppressKeyPress statements are before or after the PerformClick() statement. What magic am I missing?