VB怎样实现锁定键盘上的一些键?
2个回答
展开全部
凑个热闹:
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(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
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
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询