Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to handle keypress event in datagridview cell
Message
From
11/01/2009 12:03:45
 
 
To
08/01/2009 23:40:17
Arjun Bagojikop
Dynamic Super Software
Sangli, India
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01370794
Message ID:
01372651
Views:
25
Glad you got it working, Arjun!! =0)

But your solution made me curious about something. I had heard about and have used the ProcessCmdKey method, but this was the first time I'd seen the ProcessDialogKey method. So I wondered what the differences were. I found two excellent articles on keystroke processing that I highly recommend:

http://blogs.msdn.com/jfoscoding/archive/2005/01/24/359334.aspx
http://www.devx.com/dotnet/Article/39607/1763/page/1

Happy reading!

~~Bonnie




>thanks a lot for aditional info.
>
>i got my result
>
>Public Class dssgridview
>    Inherits DataGridView
>    Sub New()
>        Me.AutoGenerateColumns = False
>
>    End Sub
>    Protected Overrides Function ProcessDialogKey( _
>           ByVal keyData As Keys) As Boolean
>        ' Extract the key code from the key value. 
>        'Dim key As Keys = keyData And Keys.KeyCode
>        'MsgBox("OK")
>
>        ' Handle the ENTER key as if it were a RIGHT ARROW key. 
>        If keyData = Keys.Enter Then
>
>            Me.ProcessRightKey(keyData)
>            'SendKeys.Send("{tab}")
>            Return False
>
>        End If
>        Return MyBase.ProcessDialogKey(keyData)
>    End Function
>
>End Class
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform