Experts Exchange connects you with the people and services you need so you can get back to work.
Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean
Const WM_KEYDOWN As Integer = &H100
Const WM_SYSKEYDOWN As Integer = &H104
If ((msg.Msg = WM_KEYDOWN) Or (msg.Msg = WM_SYSKEYDOWN)) Then
Select Case (keyData)
Case Keys.A To Keys.Z '<--- Catch the Keys you want
MessageBox.Show("You pressed " & ChrW(keyData)) '<--- Then do something
Me.Text = "Right Arrow Captured"
Me.Text = "Left Arrow Captured"
Me.Text = "Down Arrow Captured"
Me.Text = "Up Arrow Captured"
Me.Text = "Tab Key Captured"
Case (Keys.Control Or Keys.A)
Me.Text = "<CTRL> + A Captured"
Case (Keys.Alt Or Keys.Z)
Me.Text = "<ALT> + Z Captured"
Me.Text = "Num Pad '0' Captured"
Return MyBase.ProcessCmdKey(msg, keyData)
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Be seen. Boost your question’s priority for more expert views and faster solutions