Hi All,
I'm having an issue with my KeyDown events.
When using a form without any controls (just a blank form) this code works;
If (e.KeyCode = Keys.Q) AndAlso (e.Modifiers = Keys.Control) Then
msgbox("Control & q have been pressed")
End If
However when Im using a form with controls on it, this code no longer works. I've read about the KeyPreview which needs to be set in order for the form to receive key press's etc... before any of the controls do, now I have added this to Form1_Load;
KeyPreview.Equals(True)
but this doesn't seem to get the message box to appear and I'm running out of ideas.
Thanks
Swain90
I'm having an issue with my KeyDown events.
When using a form without any controls (just a blank form) this code works;
If (e.KeyCode = Keys.Q) AndAlso (e.Modifiers = Keys.Control) Then
msgbox("Control & q have been pressed")
End If
However when Im using a form with controls on it, this code no longer works. I've read about the KeyPreview which needs to be set in order for the form to receive key press's etc... before any of the controls do, now I have added this to Form1_Load;
KeyPreview.Equals(True)
but this doesn't seem to get the message box to appear and I'm running out of ideas.
Thanks
Swain90