|
-
Apr 4th, 2008, 04:28 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Loop + Unload = Problem
Hello,
I am using the following approach to do some simple animation inside a picture box:
Code:
Dim bFlag as Boolean
Private Sub StartAnimation()
bFlag = True
Do While bFlag
'Do Animation
DoEvents
Sleep 10 'update every 10 milliseconds
Loop
End Sub
Private Sub StopAnimation()
bFlag = False
End Sub
Now when i unload my form while the animation is on, i try to call the StopAnimation function, but that doesn't stop the animation, and my app is left hanging (it doesnt unload, but rather becomes invisible or something). In IDE mode, i have to press the "Stop" button. When compiled, the program can still be found in the apps list and the processes list of the task manager after i exit it while the animation loop is running.
I am seeking some suggestions on how to deal with this matter WITHOUT RECURRING TO USING TIMERS FOR MY ANIMATION LOOP.
Thank you.
"And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)
"Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)
" There's a light at the end of every tunnel, just pray it's not a train!! "
I am 100% addicted to Tupac. What about you?
I am 24% addicted to Counterstrike. What about you?
The #1 Tupac Fans Web Site | The Official Tupac Web Site
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|