Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Tracking Tab Key Press in DataGridView

Tracking Tab Key Press in DataGridView

Scheduled Pinned Locked Moved Visual Basic
csshelpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SekharOne
    wrote on last edited by
    #1

    How can I track the keypress of Tab Key in a DataGridView. The column in which I want to track is of a textbox type column. Your suggestions will help me a lot. CSS.

    Sekhar :)

    D 1 Reply Last reply
    0
    • S SekharOne

      How can I track the keypress of Tab Key in a DataGridView. The column in which I want to track is of a textbox type column. Your suggestions will help me a lot. CSS.

      Sekhar :)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      What do you mean by "tracking a TextBox column"?? What do you want to do when the user hits the Tab key??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      S S 2 Replies Last reply
      0
      • D Dave Kreskowiak

        What do you mean by "tracking a TextBox column"?? What do you want to do when the user hits the Tab key??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        S Offline
        S Offline
        Salman Sheikh
        wrote on last edited by
        #3

        use keydown or keyup event and check e.keydata = keys.tab :)

        Salman Sheikh

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          What do you mean by "tracking a TextBox column"?? What do you want to do when the user hits the Tab key??

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          S Offline
          S Offline
          SekharOne
          wrote on last edited by
          #4

          I have a TabControl and several pages to it. Each of the pages contains one datagridview and few buttons. I want when i press the tab key on the last cell of the last row of a datagridview, it should take me to the next page of the Tabcontrol and place the focus on the first cell of the datagridview of that page. So for this I need to track the keypress for the cell from which i want to shift the focus to the next page's datagridview. And the last column of the datagridview is a textBox type column.

          Sekhar :)

          D 1 Reply Last reply
          0
          • S SekharOne

            I have a TabControl and several pages to it. Each of the pages contains one datagridview and few buttons. I want when i press the tab key on the last cell of the last row of a datagridview, it should take me to the next page of the Tabcontrol and place the focus on the first cell of the datagridview of that page. So for this I need to track the keypress for the cell from which i want to shift the focus to the next page's datagridview. And the last column of the datagridview is a textBox type column.

            Sekhar :)

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            In that case, you handle the KeyDown event of the DGV and check the event args KeyCode property for the Keys.Tab key. If pressed, you have to check to see what the cuurnet cell is. If the current cell is the last one, you set the Handled propery of the event args to True and make your changes to the TabControl. Otherise, you do nothing.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups