locked
key down "thingy" RRS feed

  • Question

  • i have a textbox that i want to do something when i press enter......

    whats the code??

     

    (textbox navigation bar)

     

    :)

     


    I like..... Understandable Answers 1 2 3 4 5 - - - - - Rate yourself And Have A Kitkat 5 5 5 5 5
    Tuesday, March 29, 2011 8:02 PM

Answers

  • Deleted
    • Marked as answer by Darkhalodude Wednesday, March 30, 2011 4:49 PM
    Tuesday, March 29, 2011 8:12 PM
  • 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
        'run your code
      End If
    End Sub
    

    thanks for any help
    • Marked as answer by Darkhalodude Wednesday, March 30, 2011 4:49 PM
    Tuesday, March 29, 2011 8:13 PM
  • In addition to the other replies, you can find what events are available for a control by selecting it in the designer and looking at its properties: click the lighting icon and it shows them to you. Double-click one for it to generate the event handler code stub.

    HTH,

    Andrew

    • Marked as answer by Darkhalodude Wednesday, March 30, 2011 4:48 PM
    Tuesday, March 29, 2011 9:06 PM

All replies

  • 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
        'run your code
      End If
    End Sub
    

    thanks for any help
    • Marked as answer by Darkhalodude Wednesday, March 30, 2011 4:49 PM
    Tuesday, March 29, 2011 8:13 PM
  • In addition to the other replies, you can find what events are available for a control by selecting it in the designer and looking at its properties: click the lighting icon and it shows them to you. Double-click one for it to generate the event handler code stub.

    HTH,

    Andrew

    • Marked as answer by Darkhalodude Wednesday, March 30, 2011 4:48 PM
    Tuesday, March 29, 2011 9:06 PM