凑个热闹:
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub Form_KeyPress(Key As Integer)
被锁字符集 = "ABCa啊" '你可以将想锁定的任何键或字符放在该字符串中
Key = IIf(InStr(被锁字符集, Chr(Key)) > 0, 0, Key)
End Sub
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc("A") Then KeyAscii = 0 '锁定A
If KeyAscii = Asc("a") Then KeyAscii = 0 '锁定a
'.......
End Sub