You can set KeyPreview = truein your form to catch keyboard events.
EDITED so you understand:
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.A)
e.SuppressKeyPress = true;
}
A silly pattern that receives keyboard events and discards if A. was pressed.
If the focus is in the text field, you will see that the text is written, but not A !!
: VB.NET.
"Keypress" " ".
:
'Declare the event
Event KeyPress(KeyAscii As Integer)
Private Sub Text1_KeyPress(KeyAscii As Integer)
RaiseEvent KeyPress(KeyAscii)
End Sub