作者在 2008-05-21 19:36:44 发布以下内容
'只能输入字母
Private Sub txtWord_KeyPress(KeyAscii As Integer)
If KeyAscii < 65 Or KeyAscii > 122 Then
KeyAscii = 0
End If
End Sub
'只能输入汉字
Private Sub txt汉字_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) Like "[!一-龥]" Then
If KeyAscii <> 8 And KeyAscii <> 9 And KeyAscii <> 13 Then
KeyAscii = 0
End If
End If
End Sub
'只能输入数字
Private Sub txtNumber_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub
文件: txt输入汉字.rar