Thema: Maus in VBA
Einzelnen Beitrag anzeigen
Alt 13.04.2001, 20:08   #10
Sesa_Mina
Schwarzfußfrettchen
 
Registriert seit: 28.01.2001
Beiträge: 2.071


Beitrag

Code:
Option Explicit

Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long

Private Sub Form_Load()
   Dim x As Long, y As Long, z As Long
   Dim fact As Double
   
   fact = Screen.Width / Screen.Height
   
   For y = 0 To Screen.Height \ Screen.TwipsPerPixelY
      x = Int(y * fact)
      SetCursorPos x, y
      For z = 0 To 99
         DoEvents
      Next
   Next
End Sub
damit bewegt sich der cursor diagonal über den schirm von links oben nach rechts unten.
Sesa_Mina ist offline   Mit Zitat antworten