|
-
Dec 28th, 2002, 10:42 PM
#1
Thread Starter
Addicted Member
enter
What is the keypress number for enter?
like left click is 2? Thanks
-
Dec 29th, 2002, 04:42 AM
#2
Sleep mode
It's "13".
If you want to know others then simply check this out.
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
MsgBox(Asc(e.KeyChar))
End Sub
-
Dec 29th, 2002, 10:35 AM
#3
Thread Starter
Addicted Member
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:
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress)
If KeyPress = "13" Then
Label2.Text = "James:" & TextBox1.Text
MsgBox(Asc(e.KeyChar))
End If
End Sub
Last edited by james14; Dec 29th, 2002 at 10:44 AM.
-
Dec 29th, 2002, 01:22 PM
#4
Sleep mode
your code should looks like so :
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object _
, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) = 13 Then
'
'your code here
'
End If
End Sub
-
Dec 29th, 2002, 01:42 PM
#5
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|