vb写一个小程序
- 提问者网友:鐵馬踏冰河
- 2021-01-25 16:41
也可以是别的程序!只要能做出来就行!谢谢了大侠们!~~~~~
- 五星知识达人网友:罪歌
- 2021-01-19 22:11
- 1楼网友:杯酒困英雄
- 2019-05-27 03:16
'dim 我也是vb新手 as 提供思路.错了请自己改
private 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) private const mouseeventf_absolute = &h8000 '指定鼠标使用绝对坐标系,此时,屏幕在水平和垂直方向上均匀分割成65535×65535个单元
private sub timer1_timer() private const mouseeventf_move = &h1 '移动鼠标 private const mouseeventf_leftdown = &h2 '模拟鼠标左键按下 private const mouseeventf_leftup = &h4 '模拟鼠标左键抬起
''''中间用timer2控件控制间隔
private const mouseeventf_leftdown = &h2 '模拟鼠标左键按下 private const mouseeventf_leftup = &h4 '模拟鼠标左键抬起
private const sw = 1024 private const sh = 768 private sub screen_click(byval x as long, byval y as long) mw = x / sw * 65535 mh = y / sh * 65535 mouse_event mouseeventf_absolute + mouseeventf_move, mw, mh, 0, 0 mouse_event mouseeventf_leftdown or mouseeventf_leftup, 0, 0, 0, 0 end sub private sub command1_click() screen_click 512, 384 '点击command1之后,模拟点击屏幕中间 end sub private sub command2_click() print rnd end sub private sub form_load() me.height = me.width command2.move (me.scalewidth - command2.width) / 2, (me.scaleheight - command2.height) / 2 end sub