Results 1 to 4 of 4
  1. #1
    gwentravolta's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Location
    A cardboard Box
    Posts
    311
    Reputation
    9
    Thanks
    46

    Make An Event Occur Once?

    Code:
    Public Sub Form1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
            Dim conn As Integer
            If conn = 1 Then
                Stop
            ElseIf conn <> 1 Then
                conn = 1
                Threading.Thread.Sleep(3000)
                Label3.Text = "Connected"
                Label3.ForeColor = Color.Green
            End If
        End Sub
    Every time a re-hover the mouse, it still puts the form to sleep for three seconds. can anyone help?



    Edit: I did a different code. This one only works one time though. then decides to STOP WORKING!
    Code:
    Public Sub Form1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
            Dim timeOut As DateTime = Now.AddMilliseconds(3000)
            Do
                Application.DoEvents()
            Loop Until Now > timeOut
            Label3.Text = "jnknoren"
        End Sub
    if anyone could fix my old code, it would be lovely
    Last edited by gwentravolta; 09-11-2009 at 05:17 PM.


    Posts:
    10 posts []
    50 posts []
    100 posts []
    500 posts []

    Thanks:
    5 thanks []
    10 thanks []
    100 thanks []

    Profile:
    Make a signature []
    Set a profile picture []

    Hacks:
    Download and use a hack []
    Get a virus []
    ... or two... []
    Release my own hacks []



  2. #2
    Iamazn's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    85
    This code will work
    Code:
        Public Sub Form1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
            Dim conn As Integer
            If conn <> 1 Then
                conn = 1
                Threading.Thread.Sleep(3000)
                Label3.Text = "Connected"
                Label3.ForeColor = Color.Green
            ElseIf conn = 1 Then
                Stop
            End If
        End Sub
    End Class

  3. #3
    gwentravolta's Avatar
    Join Date
    Jan 2009
    Gender
    male
    Location
    A cardboard Box
    Posts
    311
    Reputation
    9
    Thanks
    46
    Quote Originally Posted by Iamazn View Post
    This code will work
    Code:
        Public Sub Form1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
            Dim conn As Integer
            If conn <> 1 Then
                conn = 1
                Threading.Thread.Sleep(3000)
                Label3.Text = "Connected"
                Label3.ForeColor = Color.Green
            ElseIf conn = 1 Then
                Stop
            End If
        End Sub
    End Class
    And y does that one work, while my other one doesnt?


    Posts:
    10 posts []
    50 posts []
    100 posts []
    500 posts []

    Thanks:
    5 thanks []
    10 thanks []
    100 thanks []

    Profile:
    Make a signature []
    Set a profile picture []

    Hacks:
    Download and use a hack []
    Get a virus []
    ... or two... []
    Release my own hacks []



  4. #4
    Iamazn's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Posts
    141
    Reputation
    10
    Thanks
    85
    Quote Originally Posted by gwentravolta View Post
    And y does that one work, while my other one doesnt?
    Well, I really have no idea. BUT I do have a guess

    Maybe its because in your code, it will check for "conn" first. its a BIG Maybe
    Did that code fix it?
    Last edited by Iamazn; 09-11-2009 at 10:54 PM.

Similar Threads

  1. FINISH MAKING A HACK! BUT A PROBLEM OCCURED....
    By GOLGO666 in forum WarRock Philippines Help & Discussions
    Replies: 30
    Last Post: 10-28-2011, 10:03 AM
  2. [Info] Can we make an event?
    By xxxlovexxx1 in forum WarRock Discussions
    Replies: 24
    Last Post: 01-29-2011, 07:22 AM
  3. New Dedicated Host & Upcoming Events!
    By Dave84311 in forum News & Announcements
    Replies: 4
    Last Post: 02-09-2009, 09:19 PM
  4. Plz I Want Maple Global Hacks And Where Do I Get Game Engine 2 Make The Hacks Work???
    By mattinthehat in forum MapleStory Hacks, Cheats & Trainers
    Replies: 3
    Last Post: 01-15-2006, 06:12 PM
  5. Plz Man Make Me A Sign Plz
    By Hennu50 in forum Help & Requests
    Replies: 2
    Last Post: 01-08-2006, 04:55 PM

Tags for this Thread