|
4#
楼主 |
发表于 2006-1-11 18:21:00
|
只看该作者
非常感谢小雨提供的范例
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'MsgBox KeyCode
Select Case KeyCode
Case 33, 34
'如果 KeyCode 是 PAGEUP or PAGEDOWN 那么清除键值
KeyCode = 0
End Select
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub 姓名_KeyPress(KeyAscii As Integer)
Dim strCharacter As String
' Convert ANSI value to character string.
strCharacter = Chr(KeyAscii)
' Convert character to upper case, then to ANSI value.
KeyAscii = Asc(UCase(strCharacter))
End Sub |
|