Page 1 of 1

Vb 2008 help.

Posted: March 17th, 2010, 7:06 pm
by owner123
I was trying to make something that clicks in many places. So I uploaded the MyMethod clicking. The clicking works, but for some reason my timers are wierd. Heres the code I used.

Spoiler for code.
Spoiler:

Code: Select all

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Cursor.Position = New Point(Form1.X.Text, Form1.Y.Text)
        MyMethod()

        Timer2.Start()


        Timer1.Stop()
    End Sub


'part 2
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Cursor.Position = New Point(Form2.X.Text, Form2.Y.Text)
        MyMethod()

        Timer1.Start()


        Timer2.Stop()


Yes its supposed to loop.
It only clicks once then stops.
Thanks.

Re: Vb 2008 help.

Posted: March 19th, 2010, 2:13 am
by Ken
Try this. I just reordered stuff so it stops the timers first thing in the functions, and enables the other one at the end.

Code: Select all

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer1.Stop()
        Cursor.Position = New Point(Form1.X.Text, Form1.Y.Text)
        MyMethod()
        Timer2.Start()
    End Sub

'part 2
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Timer2.Stop()
        Cursor.Position = New Point(Form2.X.Text, Form2.Y.Text)
        MyMethod()
        Timer1.Start()

Re: Vb 2008 help.

Posted: March 19th, 2010, 2:43 am
by owner123
Nope =[ Thanks for trying.