dcsimg
Results 1 to 2 of 2

Thread: Using Enter Key as TAB key in DataGridView in VB.NET

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Question Using Enter Key as TAB key in DataGridView in VB.NET

    Hi
    Any body can help
    will be appreciated
    I have some code that i am using for enter key as a tab, but the problem is when I enter some data in the datagrid view Textbox then in this case the code is not working.
    My code is here...

    Private Sub dgv_KeyDown(sender As Object, e As KeyEventArgs) Handles dgv.KeyDown

    If e.KeyCode = Keys.Enter Then
    Dim col As Integer = dgv.CurrentCell.ColumnIndex
    Dim row As Integer = dgv.CurrentCell.RowIndex
    If col < dgv.Columns.Count - 1 Then
    dgv.CurrentCell = dgv.Rows(row).Cells(col + 1)
    dgv.Focus()
    ElseIf col = dgv.Columns.Count - 1 Then
    dgv.Rows.Add(1)
    dgv.CurrentCell = dgv.Rows(row).Cells(0)
    dgv.Focus()

    End If

    End If

    I want to enter some data and then enter key work as a tab key in data grid view

    Thanks in Advance for solving the problem
    Last edited by Akbarkhan; Mar 17th, 2019 at 01:57 AM.

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    2

    Re: Using Enter Key as TAB key in DataGridView in VB.NET

    Any body can reply please

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width