Question How to Make Enter key work as tab key in datagridview

prasad kulkarni

Well-known member
Joined
Sep 7, 2009
Messages
62
Programming Experience
1-3
Hi,

how to make enter key behave like a tabkey in datagrid view, using vb.net windows application.

I have Following code,

''------------------------------------

Public Class MyDGV

Inherits DataGridView

Protected Overrides Function ProcessDataGridViewKey(ByVal e As KeyEventArgs) As Boolean

If e.KeyCode = Keys.Enter Then

Me.ProcessTabKey(e.KeyData)

Return True

End If

Return MyBase.ProcessDataGridViewKey(e)

End Function

Protected Overrides Function ProcessDialogKey(ByVal keyData As Keys) As Boolean

If keyData = Keys.Enter Then
Me.ProcessTabKey(keyData)
Return True
End If
Return MyBase.ProcessDialogKey(keyData)

End Function

End Class

''--------------------------------------------

How to Impliment Above Functionality in My Public Class From1
In my Form1 , there is datagridview .

When I press Tab in datagridview cell, then how to restrict focus move to
next cell.

if any know, please reply me soon
 
Back
Top