|
-
Oct 18th, 2001, 02:06 AM
#1
Thread Starter
Junior Member
Timer Object to control Animation speed
Great ones,
How is it possible to use the "Timer" object (looks like a stopwatch) to control the movement (velocity) of picture boxes across a form?
I don't want to use the often used code below because it burns up all CPU capacity while in the loop. Using such code the CPU is always at 100% when the picture boxes are animating across the form.
Sub Pause (Time as Single)
Dim Start as Single
Start = Timer
Do While Timer < Start + Time
Loop
End Sub
Does use of the "Timer" object cause CPU usage to go to 100%?
Thank you
-
Oct 18th, 2001, 03:04 AM
#2
Retired VBF Adm1nistrator
Dont worry about CPU usage unless you're using really complicated loops. I would use Do...Loop with a bit of GetTickCount() thrown in.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Oct 18th, 2001, 07:30 AM
#3
Good Ol' Platypus
Add a DoEvents in there... It lets Windows execute while you are in the loop.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Oct 18th, 2001, 08:12 AM
#4
Retired VBF Adm1nistrator
A pinch of Do, a smidgen of Loop, a portion of GetTickCount() and throw in a DoEvents for good measure
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
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
|