Results 1 to 5 of 5

Thread: enter

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216

    enter

    What is the keypress number for enter?
    like left click is 2? Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    It's "13".
    If you want to know others then simply check this out.

    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object, _
    2.     ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    3.  
    4. MsgBox(Asc(e.KeyChar))
    5. End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    oh ok thanks!

    So if i wanted to make enter my button that sends the text to the main chat area it would look like:

    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object, _
    2.     ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress)
    3.         If KeyPress = "13" Then
    4.             Label2.Text = "James:" & TextBox1.Text
    5.             MsgBox(Asc(e.KeyChar))
    6.         End If
    7.     End Sub
    Last edited by james14; Dec 29th, 2002 at 10:44 AM.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    your code should looks like so :
    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As Object _
    2.     , ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    3.  
    4.         If Asc(e.KeyChar) = 13 Then
    5.             '
    6.             'your code here
    7.             '
    8.         End If
    9.  
    10.     End Sub

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    Thank You!

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