Search Source
Custom Search
Private Declare Function IsCharAlpha Lib "user32" Alias "IsCharAlphaA" (ByVal cChar As Byte) As Long
Private Declare Function IsCharAlphaNumeric Lib "user32" Alias "IsCharAlphaNumericA" (ByVal cChar As Byte) As Long
Private Declare Function IsCharLower Lib "user32" Alias "IsCharLowerA" (ByVal cChar As Byte) As Long
Private Declare Function IsCharUpper Lib "user32" Alias "IsCharUpperA" (ByVal cChar As Byte) As Long
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim strSave As String
'Clear the form
Me.Cls
'Set the current Y-position to 0
Me.CurrentY = 0
'Get the character information
If IsCharAlphaNumeric(KeyAscii) Then strSave = " AlphaNumeric"
If IsCharAlpha(KeyAscii) Then strSave = "Alpha"
If IsCharLower(KeyAscii) Then strSave = strSave + " Lower"
If IsCharUpper(KeyAscii) Then strSave = strSave + " Upper"
'Print the information to the form
Me.Print "You pressed: " + Chr$(KeyAscii)
Me.Print "This is:" + strSave
End Sub
To Top