Private Sub DgvJournal_KeyPress(sender As Object, e As KeyPressEventArgs) Handles DgvJournal.KeyPress Dim keyChar As Char = e.KeyChar If AscW(keyChar) = 13 Then DgvJournal.Rows(DgvJournal.CurrentCell.RowIndex).Cells(0).Value = DgvMainAccountList.Rows(0).Cells(0).Value End If End Sub Private Sub DgvJournal_KeyDown(sender As Object, e As KeyEventArgs) Handles DgvJournal.KeyDown If e.KeyCode = Keys.Enter Then DgvJournal.Rows(DgvJournal.CurrentCell.RowIndex).Cells(0).Value = DgvMainAccountList.Rows(0).Cells(0).Value End If End Sub Private Sub DgvJournal_PreviewKeyDown(sender As Object, e As PreviewKeyDownEventArgs) Handles DgvJournal.PreviewKeyDown If e.KeyCode = Keys.Enter Then DgvJournal.Rows(DgvJournal.CurrentCell.RowIndex).Cells(0).Value = DgvMainAccountList.Rows(0).Cells(0).Value End If End Sub Private Sub FrmJournal_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If DgvJournal.Focused Then If e.KeyCode = Keys.Enter Then DgvJournal.Rows(DgvJournal.CurrentCell.RowIndex).Cells(0).Value = DgvMainAccountList.Rows(0).Cells(0).Value End If End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)