vb net 用一个按钮, 模拟键盘tab键 让网也上光标一个控件转到另一个控件控件,
点击模拟的按钮光标有反映。不过不会切换控件只是停留在同意个光标上怎么解决呀?代码PublicDeclareFunctionPostMessageLib"user32"Al...
点击模拟的按钮 光标有反映。不过不会切换控件 只是停留在同意个 光标上 怎么解决呀?
代码
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PostMessage(hEdit, WM_KEYDOWN, VK_TAB, 0) '按下F1键
PostMessage(hEdit, WM_KEYUP, VK_TAB, 0) '释放F1键
SendKeys.Send("{TAB}")
End Sub 展开
代码
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PostMessage(hEdit, WM_KEYDOWN, VK_TAB, 0) '按下F1键
PostMessage(hEdit, WM_KEYUP, VK_TAB, 0) '释放F1键
SendKeys.Send("{TAB}")
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询