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. Doing something when I press "Enter" key

Doing something when I press "Enter" key

Scheduled Pinned Locked Moved Visual Basic
help
6 Posts 4 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.
  • F Offline
    F Offline
    friendshiple
    wrote on last edited by
    #1

    I have a textbox, how i can handle press "Enter" key event, i wait for help from everyone. Thanks very much.

    A C 2 Replies Last reply
    0
    • F friendshiple

      I have a textbox, how i can handle press "Enter" key event, i wait for help from everyone. Thanks very much.

      A Offline
      A Offline
      abipeter1983
      wrote on last edited by
      #2

      I am a newbie Just try this Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then e.Handled = True End If End Sub

      1 Reply Last reply
      0
      • F friendshiple

        I have a textbox, how i can handle press "Enter" key event, i wait for help from everyone. Thanks very much.

        C Offline
        C Offline
        codeadair
        wrote on last edited by
        #3

        Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr(13) Then 'event End If End Sub ICQ:258-235-734

        A 1 Reply Last reply
        0
        • C codeadair

          Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr(13) Then 'event End If End Sub ICQ:258-235-734

          A Offline
          A Offline
          alwinSCH
          wrote on last edited by
          #4

          Hi, I used this: Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr(13) Then 'event End If End Sub --> but it didn't work in my application is there some property of the textbox that must be true or false to use this? I can hit any other key and it works fine but when i hit enter he does not go to this procedure I use VS2005 what could i do, please help? Thanks Alwin

          A 1 Reply Last reply
          0
          • A alwinSCH

            Hi, I used this: Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr(13) Then 'event End If End Sub --> but it didn't work in my application is there some property of the textbox that must be true or false to use this? I can hit any other key and it works fine but when i hit enter he does not go to this procedure I use VS2005 what could i do, please help? Thanks Alwin

            A Offline
            A Offline
            alwinSCH
            wrote on last edited by
            #5

            Never mind I solved it myself! When i put off the Acceptbutton property of the form it was OK! Thanks Anyway A.

            C 1 Reply Last reply
            0
            • A alwinSCH

              Never mind I solved it myself! When i put off the Acceptbutton property of the form it was OK! Thanks Anyway A.

              C Offline
              C Offline
              codeadair
              wrote on last edited by
              #6

              That's Right ICQ:258-235-734 MSN:msnadair@hotmail.com

              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