Advertisement
ASP_Volume3 Files/ File Controls/ Input/ Output #60927

Detect Enter Key (vbkeyreturn) in Keypress Event

It able to detect ENTER key press by user. VB6 use " Keyascii = vbkeyreturn " but .Net need to write another function to detect it. Try to use this function to help you. Vote this code if you found it useful 2 you.

AI

Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Codice sorgente
original-source
Public Function KeyAscii(ByVal UserKeyArgument As KeyPressEventArgs) As Short
 KeyAscii = Asc(UserKeyArgument.KeyChar)
End Function
Private Sub txtusername_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtusername.KeyPress
 If User.KeyAscii(e) = 13 Then
  msgbox "you press ENTER key"
 End If
End Sub
Upload
Commenti originali (3)
Recuperato da Wayback Machine