详细使用代码见
http://www.xrss.cn/Info/15310.Html
VB光标移动有两蚂镇吵历种方式:
1. 移动到指定控件,转移焦点:
Text1.SetFocus2. 移动指定文本字符闷碰粗串位置:
Text1.SelStart=Len(Text1)调用api在Visual Baisc.net中的声明:
Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2 '知穗虚模拟鼠标左键按下
Public Const MOUSEEVENTF_LEFTUP = &H4 ’模拟鼠标左键释放
Public Const MOUSEEVENTF_MIDDLEDOWN = &H20 '模拟鼠标中间键按下
Public Const MOUSEEVENTF_MIDDLEUP = &H40 '模拟鼠标中间键族睁释放
Public Const MOUSEEVENTF_RIGHTDOWN = &H8 '模拟鼠标右键按下
Public Const MOUSEEVENTF_RIGHTUP = &H10 '模拟鼠标右键释放
Public Const MOUSEEVENTF_MOVE = &H1 '模拟鼠标指针移动搭燃
例:
mouse_event MOUSEEVENTF_LEFTDOWN,10,10,0,0
'在(10,10)模拟鼠标左键按下
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)