Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing the user hitting enter on keyboard

Status
Not open for further replies.

majordog

Programmer
Jul 8, 2002
222
0
0
CA
Hey All,

Web app - I'm trying to capture the user hitting enter on the keyboard. Is there a way to do this?
 
hi
u can use the keypress event ans use enter key ascii number tat i.e 13
Amna

Private Sub frm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
If (e.KeyChar = Microsoft.VisualBasic.ChrW(13)) Then
Me.close()
End if
End Sub

 
hi
u can use the keypress event and use ENTER key ascii number i.e 13 hope it will solve ur problem....

bye
Amna


Private Sub frm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress
If (e.KeyChar = Microsoft.VisualBasic.ChrW(13)) Then
Me.close()
End if
End Sub

 
Thanks - I was using some javascript that wasn't quite doing what I wanted - I should have thought of the form events - Thanks alot!
 

Actually, I think I spoke too soon - This is a web application - unless I am missing soething here I can't import the system.windows.forms namespace....
This won't work for me.... :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top