Results 1 to 3 of 3

Thread: Textbox value entering

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Middle of nowhere
    Posts
    45

    Textbox value entering

    hey,

    is there i way i can have an event triggered by hitting enter in a text box?

    Like, instead of having a button that checks to see whats in a text box and then using that statement to perform an action, can i just have it to where when your done typing you hit enter and it checks the value and then performs the action?

    Tried doing "textValuechanged" but the problem with that is that once the value of the text box is inputed, i cant clear the text without performing the action again.

    (one of the things im doing is a toggle type thing, so whenever i try to delete it it unchanges what i had the text value change)

    Thanks in advanced, and if no one can help, oh well, thanks anyway.

    ---Flac
    Everything great once started with the words "That will never catch on, you shouldnt even bother" be great, go against the crowed, do something stupid, you might become famous.

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Like this ?
    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    2.         If Asc(e.KeyChar) = 13 Then
    3.             CallMe()
    4.         End If
    5.     End Sub
    6.  
    7.     Private Sub CallMe()
    8.         MessageBox.Show("You just pressed Enter")
    9.     End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Middle of nowhere
    Posts
    45
    Hey, thanks a lot, just gotta figure out how to apply it to what im doing. But ya, thats what i was looking for.

    ---Flac
    Everything great once started with the words "That will never catch on, you shouldnt even bother" be great, go against the crowed, do something stupid, you might become famous.

Posting Permissions

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



Click Here to Expand Forum to Full Width