היי יש לי את הקוד הבא שגורם לעכבר לזוז מצד לצד והוא אמור גם ללחוץ אבל הוא עושה לי שגיאה בשורה המסומנת:]קוד HTML:Public Class Form1 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Long Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Integer, ByVal dy As Long, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer) Private Const mouseclickup = 4 Private Const mouseclickdown = 2 Private NB_Turn As Integer Private ElipseAngle As Double Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load TextBox1.Text = "0" 'Height of the elipse TextBox2.Text = "500" 'Width of the elipse TextBox3.Text = "300" 'X coordinate of center TextBox4.Text = "300" 'Y coordinate of center NB_Turn = 3 'Number of turn to do ElipseAngle = 0 'Angle of the elipse (In Radian) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click click1.Start() Dim H = CInt(TextBox1.Text) Dim W = CInt(TextBox2.Text) Dim CenterX = CInt(TextBox3.Text) Dim CenterY = CInt(TextBox4.Text) Dim RadIncrement As Double = Math.PI / 100 Dim i As Double = 0 Do Dim X = CenterX + W * Math.Cos(i) * Math.Cos(ElipseAngle) - H * Math.Sin(i) * Math.Sin(ElipseAngle) Dim Y = CenterY + W * Math.Cos(i) * Math.Sin(ElipseAngle) - H * Math.Sin(i) * Math.Cos(ElipseAngle) Cursor.Position = New Point(CInt(X), CInt(Y)) Threading.Thread.Sleep(10) i += RadIncrement Loop Until i > 2 * Math.PI * NB_Turn End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click click1.Stop() End Sub Private Sub HotKeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim HotKey1 As Boolean HotKey1 = GetAsyncKeyState(Keys.F5) If HotKey1 = True Then click1.Start() End If Dim HotKey2 As Boolean HotKey2 = GetAsyncKeyState(Keys.F3) If HotKey2 = True Then click1.Stop() End If End Sub Private Sub click1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles click1.Tick mouse_event(mouseclickdown, 0, 0, 0, 0) mouse_event(mouseclickup, 0, 0, 0, 0) End Sub End Class
וגם ה HOTKEYS לא עובד לי למה? מה לא בסדר בקוד?<



ציטוט ההודעה