No, the opposite is true. Using your code, SomeMethodButtonClickRuns will be executed if the user presses Ctrl+P, Ctrl+Alt+P, Ctrl+Shift+P or Ctrl+Alt+Shift+P. Using my code, the method will only be executed if the user presses Ctrl+P. If you want all four key combinations to do the same thing then your code would be OK but that would be a very rare thing and basically bad programming.
For instance, I'm typing this in Firefox and if I press Ctrl+Alt+P then nothing happens, while Ctrl+P brings up the Print dialogue. Using your code Ctrl+Alt+P would bring up the Print dialogue too.
Using code like yours you'd have to do this:
vb.net Code:
If e.Control = True And e.Alt = False And e.Shift = False And e.KeyCode = Keys.P Then
or, better:
vb.net Code:
If e.Control AndAlso Not e.Alt AndAlso Not e.Shift AndAlso e.KeyCode = Keys.P Then
I think:
vb.net Code:
If e.KeyData = (Keys.Control Or Keys.P) Then
is a better option.