vb.net 鼠标控制

前端之家收集整理的这篇文章主要介绍了vb.net 鼠标控制前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。



  1. Public Class Form1
  2. Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long)
  3. 'LEFTDOWN = &H2
  4. 'LEFTUP = &H4
  5. 'RIGHTDOWN = &H8
  6. 'RIGHTUP = &H10
  7. 'MIDDLEUP = &H40
  8. 'MIDDLEDOWN = &H20
  9. Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click
  10. Me.Cursor = New Cursor(Cursor.Current.Handle)
  11. Cursor.Position = New Point(150,150)
  12. mouse_event(&H2)
  13. Cursor.Position = New Point(250,250)
  14. mouse_event(&H4)
  15. Cursor.Position = New Point(250,250)
  16. mouse_event(&H8)
  17. Cursor.Position = New Point(350,350)
  18. mouse_event(&H10)
  19. End Sub
  20. End Class

猜你在找的VB相关文章