DataGrid Get F3 keypress

A

Agnes

I design my own datagrid which can turn Enter into 'Tab', BUT I cannot
detect the user keypress 'F3' , Why
I try to detect keyCode, it only effect on 'keydown' , 'keyup' , but it
cannot get my keypress 'FX'
Anybody got idea ? thanks a lot

Protected Overrides Function ProcessKeyPreview(ByRef m As
System.Windows.Forms.Message) As Boolean
Dim keyCode As Keys = CType(m.WParam.ToInt32(), Keys) And
Keys.KeyCode
If m.Msg = WM_KEYDOWN And keyCode = Keys.Enter Then
m.WParam = New IntPtr(Keys.Tab)
endif
end function
 
A

Agnes

I got the solution , I should use the following method
Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As
Boolean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top