VB如何实现关闭键盘功能?
1个回答
展开全部
Private Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub Command1_Click() Call EnableWindow(Me.hwnd, 0) Me.Caption = "现在拒绝KeyPress, MouseClick" Dim i As Long For i = 1 To 100 Call Sleep(100) DoEvents '虽有DoEvents,会发现,按Form的任何地方都没有反应 Next i Me.Caption = "现在解除了" Call EnableWindow(Me.hwnd, 1) End Sub 说明:VB.net 也支持API函数。 这个算不???
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询