Private Sub dgvDetailProductReceive_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles dgvDetailProductReceive.KeyDown
If (e.KeyCode = Keys.Enter) Then
Dim numCols As Integer = dgvDetailProductReceive.ColumnCount
Dim numRows As Integer = dgvDetailProductReceive.RowCount
Dim currCell As DataGridViewCell = dgvDetailProductReceive.CurrentCell
If currCell.ColumnIndex = numCols - 1 Then
If currCell.RowIndex < numRows - 1 Then
dgvDetailProductReceive.CurrentCell = dgvDetailProductReceive.Item(0, currCell.RowIndex + 1)
End If
Else
dgvDetailProductReceive.CurrentCell = dgvDetailProductReceive.Item(currCell.ColumnIndex + 1, currCell.RowIndex)
End If
e.Handled = True
End If
End Sub