I had the same problem, except I needed the beep removed on the entire
form. One possible way is to put a Menu Strip on the form and set
visible to false if you don't use it.
The solution I found was to set e.SuppressKeyPress to True after
handling the form's KeyDown event. So your code would look something
like:
Private Sub frm_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.Alt AndAlso e.KeyValue = Keys.A Then
<EXECUTE ALT-A CODE HERE>
e.SuppressKeyPress = True
End If
End Sub
The form will still beep when you hit another Alt combination that is
not explicitly handled and then the args keypress suppressed as above.
Drew
Cor Ligthert [MVP] wrote:
Paul,
There is a very old answer that was always done by Armin Zingler in past in
this newsgroup.
http://groups.google.com/group/micro...9f0dc571012f2d
If this is not the right have than a search yourself than for Armin Zingler
on Google in this Newsgroup.
However, I hope this helps direct.
Cor
"Paul" <pw****@hotmail.comschreef in bericht
news:11**********************@i42g2000cwa.googlegr oups.com...
I created a sample Project with a basic form and one text box. I put
"e.Handled = True" on every KeyDown, KeyPress and KeyUp event for both
the Form and the TextBox. When I run the app, and press the Alt+A (or
any Alt+character) button, it beeps (very annoying). Does anyone know
why and how to fix it?