detecting key and mouse clicks inside a loop!?
Im trying to detect either a mouse click or a keypress while runing a for/next loop. is there a command that will allow me to check for such events while inside a loop.
for x=1 to infinity
'i want to check for a mouse or keypress here
next
as you probably know while aloop is running all operations suspend as far as
normal VB event go and they are not detected.
Thanks.
Re: detecting key and mouse clicks inside a loop!?
Hi
First you need to insert DoEvents in the loop. This makes sure your program can process any messsages.
Second, you have to need a boolean to see if the mouse is clicked or a key is pressed (set it to true if it is -> do this in the Click and KeyDown events)
Check in the loop if the boolean is true.
This should work.
Hope this helps
Crazy D