Vb 2008 help.

Get help with just about anything and everything NOT Warcraft related. Computers, consoles, phones, whatever!
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 1 time

Vb 2008 help.

Post 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.
User avatar
Ken
Spice Pirate
Posts: 862
Joined: January 29th, 2009, 5:35 pm
Title: LHC
Location: Canada

Re: Vb 2008 help.

Post 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()
Spoiler:
xkiska wrote:BARTIMEAUS is more understandable then u
Senethior459 wrote:Wow, Dream Theatre reminds me of Dragonforce, but with real skill.
Ozzapoo wrote:We laughed, we cried. Trashed.
FatherSpace: You don't find smart chicks hawt?
GeorgeMots: not anymore, im fed up with that kind of girls
FatherSpace: lol
FatherSpace: What happened?
GeorgeMots: most smart girls find out that i date/do/see other girls....
FatherSpace: ...
FatherSpace: So monogamy is your enemy?
Bartimaeus: Hmm, well, I hope my sister hasn't been kidnapped.
FatherSpace: What happened, Bart?
Bartimaeus: She walked out of the house saying that she was going over to some friends, and it's been like two hours, and my mom is trying to get a hold of her, which she's been unable to.
Bartimaeus: I can also hear three car alarms going off.
GeorgeMots: how old is she?
Bartimaeus: I haven't a clue. Probably 17.
UndeadxAssassin: wut
AbusivePie: You don't know how old your sister is?
Bartimaeus: Nope.
UndeadxAssassin: Epic fail
GeorgeMots: is she cute??
Bartimaeus: So, uh, how about you get into the Christmas spirit and put that avatar on before I do it myself and take away your bloody avatar-changin' rights?
UndeadxAssassin: If I thought of a random one...
UndeadxAssassin: Like....
UndeadxAssassin: I'll get back to you on that
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm
Been thanked: 1 time

Re: Vb 2008 help.

Post by owner123 »

Nope =[ Thanks for trying.