|
Проверить тип вводимой информации |
|
|
Простая проверка регистра, буква или цифра,используя API
Добавьте TextBox на форму Private Declare Function IsCharUpper Lib "user32" Alias
"IsCharUpperA" (ByVal cChar As Byte) As Long
Private Declare Function IsCharLower Lib "user32" Alias "IsCharLowerA"
(ByVal cChar As Byte) As Long
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 Sub Text1_KeyPress(KeyAscii As Integer)
'1 - True, 0 - False
MsgBox "Upper Case: " & IsCharUpper(KeyAscii) & " Lower Case:
" & IsCharLower(KeyAscii) & " Alpha: " & IsCharAlpha(KeyAscii)
& " Alpha or Numeric: " & IsCharAlphaNumeric(KeyAscii)
End Sub
|
|
|
|
|
|
|