View Single Post
Join Date: Nov 2008
Posts: 6
Reputation: harrybern is an unknown quantity at this point 
Solved Threads: 0
harrybern harrybern is offline Offline
Newbie Poster

Re: Programming keyboard keys in vb.net

 
0
  #3
Dec 2nd, 2008
Thanks for your reply...code is working beautifully

I am using space key to initialize a thread which starts flashing text on the screen. Now the problem is that if i press the same key again then same thread gets started again and t.abort or t.suspend is not working either.
My idea is pause the thread if the same key is pressed again...like an on off button..

If e.KeyCode = Keys.Space Then

Dim value As Boolean = False

Control.CheckForIllegalCrossThreadCalls = value

Dim t As Thread

t = New Thread(AddressOf rsvp)

If t.IsAlive = False Then

t.Start()


Else : t.Abort()

End If
End If
Reply With Quote