oups there is something missing..
if you want to get notify for regular keys (A, b, 9, etc..) you can handle
WM_KEYDOWN too
'***
Public Class DataGridEx
Inherits DataGrid
Private Const WM_KEYDOWN As Int32 = &H100
Private Const WM_SYSKEYDOWN As Int32 = &H104
Private Const VK_DOWN As Int32 = &H28
Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As System.Windows.Forms.Keys) As
Boolean
If (msg.Msg = WM_SYSKEYDOWN) Then
Console.WriteLine("WM_SYSKEYDOWN")
If (msg.WParam.ToInt32() = VK_DOWN) Then
Console.WriteLine("VK_DOWN")
If (Control.ModifierKeys = Keys.Alt) Then
Console.WriteLine("bingo!")
Return True
End If
End If
ElseIf (msg.Msg = WM_KEYDOWN) Then
Console.WriteLine("VK: {0}, Char: {1}", msg.WParam.ToInt32(),
CType(msg.WParam.ToInt32(), Keys).ToString())
End If
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
End Class
'***
I'm not a hundred percent sure that a Virtual Key code (WParam) could be
convert into a Keys type though...
--
Best Regards
Yanick
"Zoury" <yanick_lefebvre at hotmail dot com> a écrit dans le message de
news:Ok****************@TK2MSFTNGP10.phx.gbl...
ok then, try something like this :
http://groups.google.com/groups?selm...tngp13.phx.gbl
--
Best Regards
Yanick
"Geoff Jones" <no********@email.com> a écrit dans le message de
news:41**********************@news.dial.pipex.com. .. Hi Zoury
Any really e.g. "A", "B", "Alt Z"
Geoff
"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:e3******************@TK2MSFTNGP10.phx.gbl...> What keys ?
for my own knowledge... shoudn't it be "which keys" or i can say both
?
--
Best Regards
Yanick
>
> --
> Best Regards
> Yanick
> "Geoff Jones" <no********@email.com> a écrit dans le message de
> news:41**********************@news.dial.pipex.com. ..
> > Hiya
> >
> > Can anybody help me with the following?
> >
> > I'm overriding PreProcessMessage on a DataGrid in order to capture
> > keys.
> > However, the function is only called sometimes i.e. there doesn't seem to
> be
> > any pattern.
> >
> > Can anybody help?
> >
> > Geoff
> >
> >
>
>