Capturing down-arrow key on Datagrid with IsInputKey()

  • Thread starter Thread starter Raymond Fenske
  • Start date Start date
R

Raymond Fenske

I am trying to capture the press of the down-arrow key on
a Datagrid. The online doc states that to accomplish this
I need to override IsInputKey() first, but I am unable to
get this to work. Does anyone have a working code sample?

Thanks
 
Here's the method I override to capture that:

Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys)
As Boolean

Const WM_KEYDOWN As Integer = &H100
Const WM_KEYUP As Integer = &H101

If msg.Msg = WM_KEYDOWN Then
If msg.WParam.ToInt32() = CInt(Keys.Tab) Then
DataGrid1_KeyDown(Nothing, New KeyEventArgs(keyData))
Return True
End If
End If

End Function
 
Back
Top