如何禁用用户';在VB.net中使用鼠标和键盘(使鼠标不可见)?

如何禁用用户';在VB.net中使用鼠标和键盘(使鼠标不可见)?,vb.net,visual-studio,input,Vb.net,Visual Studio,Input,在visual basic中,如何使用户的光标不可见以及键盘输入未“启用”?请尝试以下代码。将这些API声明添加到degrations部分: 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

在visual basic中,如何使用户的光标不可见以及键盘输入未“启用”?

请尝试以下代码。将这些API声明添加到degrations部分:

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

检查这里,如果您正在使用网格控制,如ultra Grid。您可以使用以下代码在Ultrgrid e.SuppressKeyPress=True的keydown事件中