2011-05-24 169 views

回答

2

请尝试下面的代码。添加这些API声明您declations部分:

Private Declare Function BlockInput Lib "user32" Alias "BlockInput" (ByVal fBlock As Integer) As Integer 
Private Declare Function ShowCursor Lib "user32" (ByVal lShow As Long) As Long 

在你的方法,添加以下代码:

BlockInput 1 
ShowCursor 0 

要重新启用键盘和鼠标,请尝试以下操作:

BlockInput 0 
ShowCursor 1 
+0

如果你正在使用网格控制像超网格。您可以在Ultrgrid e.SuppressKeyPress = True的keydown事件中使用以下代码 – Uttam 2017-09-26 07:29:34