Timer Device problem in VB

Jul 16, 2011 at 2:08 PM

I am calling a function in timer device and applying some if condition to stop it from repeatedly stop the function from executing but I am failed to do so, so any help will be appreciated thnx!  Here is my code 

keyTemp is globally declared 


Dim keyTemp As String = Nothing 

Private Sub Hot_Checker_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hot_Checker.Tick
        If keyTemp = Nothing Then           

          gKey.CheckBox()         'checks if the hotkey is pressed   

          keyTemp = gKey.getHkey()            'gets the pressed hotkey

         TextBox2.Text = keyTemp       

          ElseIf keyTemp <> Nothing Then           


        End If

    End Sub


I have tried to solve this any other ways also but failed. All I have to do is to make the keyTemp value as nothing but If I'll make it nothing in the end of this function then my function will only execute the first half and then it won't visit the else if part the ReadIt() function will never be called, where should I make the keyTemp variable to nothing ....Please help...I want this function to be called when a hotkey is pressed and again if any other hotkey is pressed but this function won't stop executing unless I stop the process from the task manager!!!!!!!