Does anyone know how this can be done? I have looked at the IsInputKey and PreProcessKey but haven't had any luck with either one of them. I then made a new class for the datagrid as follows:
This changes the header text, but I can't figure out how to call the datagrid from this class. Any ideas? I'm stumped.
Thanks in advance,
Jeremy
Code:
Public Class MyDataG
Inherits System.Windows.Forms.DataGrid
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.Enter
Me.Parent.Text = "Enter Key Captured"
End Select
End If
Return MyBase.ProcessCmdKey(msg, keyData)
End Function
End Class
This changes the header text, but I can't figure out how to call the datagrid from this class. Any ideas? I'm stumped.
Thanks in advance,
Jeremy