I'm developing a VB.net windows application and i want it to operate using key press i.e. hotkeys. I want it to work when user press a key from keyboard e.g if P is pressed it should print like that. please help me to do this.
VB.Net Windows Application How to Set Hot Keys?
Hi friends,
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Apr 30, 2013, 9:03 AM EDT
If you do this, then you can prevent the keystroke from going to the control at all by setting the KeyPreviewEventArg's Handled property to true.
For example:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyCode = Keys.P Then
MessageBox.Show("P was pressed")
e.Handled = True
End If
End Sub
Javeed M ShaikhRank #839 · 2.7K reputationPosted Apr 30, 2013, 7:56 AM EDT
http://windowscoding.com/blogs/blake/archive/2009/05/19/how-to-register-a-keyboard-shortcut-hot-key-in-a-net-windows-forms-application.aspx