This is my code for pressing Enter Key and moving to the next cell:
Private Sub dvFromAlloc_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dvFromAlloc.CellEndEdit
SendKeys.Send("{up}")
SendKeys.Send("{right}")
End Sub
Private Sub dvFromAlloc_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dvFromAlloc.KeyDown
If e.KeyCode = Keys.Enter Then
SendKeys.Send("{up}")
SendKeys.Send("{right}")
End If
End Sub
This is perfectly working, now what I want is if the user is in the last column, how can I move the cell to the first column of the second row?
Thank you.
Best Answer
You may try this in your
KeyDown
event ..