First up, you should use this:rather than this:vb.net Code:
If e.KeyData = (Keys.Control Or Keys.P) ThenThat's because the first snippet will trap only Ctrl+P while the second will also trap Ctrl+Shift+P, Ctrl+Alt+P and Ctrl+Alt+Shift+P.vb.net Code:
If e.Control = True And e.KeyCode = Keys.P Then
As for why it's not working, the only reason I can think of is that you haven't set the form's KeyPreview to True, as instructed in post #7.




Reply With Quote