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. Problem with WinForm Application Tab Control using VB.NET2008 Framework 2.0

Problem with WinForm Application Tab Control using VB.NET2008 Framework 2.0

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasequestion
3 Posts 2 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.
  • D Offline
    D Offline
    drexler_kk
    wrote on last edited by
    #1

    Hello all, I would like to make the Tab movement can also pressing the "Enter" Key. I have google and found the code which possible to used. But I found its not running fine with me. When I press "Enter" key,it runs fine for the tab movement. But if I put something into my textbox,it only allowed me to put 1 character and it will move next. Anyone can help me solve this? Because the Textbox 2 can able to put in any kind of numbers. But after add in the code that allowed "Enter" key move the Tabindex,it will move to the next tab index after I lick 1 character. Please help me to check is that I use this code wrongly?

    Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

        If Keys.Enter Then
            SendKeys.Send("{TAB}")
            Exit Sub
        End If
    
        Select Case e.KeyChar
            Case "0" To "9"
            Case Microsoft.VisualBasic.ChrW(8) 'backspace
                'Case Microsoft.VisualBasic.ChrW(46) 'dot (.)
                '    If InStr(TextBox2.Text, ".") > 0 Then
                '        e.Handled = True
                '    End If
    
            Case Else
                e.Handled = True
        End Select
    
    End Sub
    

    Thanks you all so much for reading. Anyone can give me some suggestion how should I do to make the "Enter" key press work as tab? Regards Drex

    S 1 Reply Last reply
    0
    • D drexler_kk

      Hello all, I would like to make the Tab movement can also pressing the "Enter" Key. I have google and found the code which possible to used. But I found its not running fine with me. When I press "Enter" key,it runs fine for the tab movement. But if I put something into my textbox,it only allowed me to put 1 character and it will move next. Anyone can help me solve this? Because the Textbox 2 can able to put in any kind of numbers. But after add in the code that allowed "Enter" key move the Tabindex,it will move to the next tab index after I lick 1 character. Please help me to check is that I use this code wrongly?

      Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress

          If Keys.Enter Then
              SendKeys.Send("{TAB}")
              Exit Sub
          End If
      
          Select Case e.KeyChar
              Case "0" To "9"
              Case Microsoft.VisualBasic.ChrW(8) 'backspace
                  'Case Microsoft.VisualBasic.ChrW(46) 'dot (.)
                  '    If InStr(TextBox2.Text, ".") > 0 Then
                  '        e.Handled = True
                  '    End If
      
              Case Else
                  e.Handled = True
          End Select
      
      End Sub
      

      Thanks you all so much for reading. Anyone can give me some suggestion how should I do to make the "Enter" key press work as tab? Regards Drex

      S Offline
      S Offline
      S M kanerkar
      wrote on last edited by
      #2

      Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress IF asc(e.KeyChar) = 13 THEN write your code into this u will get write output End If End Sub

      modified on Monday, April 20, 2009 6:33 AM

      D 1 Reply Last reply
      0
      • S S M kanerkar

        Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress IF asc(e.KeyChar) = 13 THEN write your code into this u will get write output End If End Sub

        modified on Monday, April 20, 2009 6:33 AM

        D Offline
        D Offline
        drexler_kk
        wrote on last edited by
        #3

        Thank you so much Mr. S.M.Kanerkar. Your solution works well. Regards Drex

        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