|
-
Jul 9th, 2001, 08:53 AM
#1
Thread Starter
Member
-
Jul 9th, 2001, 09:05 AM
#2
-= B u g S l a y e r =-
You could use a timer control, and add the code that do the "animation" in the Timer event. The Timers time event should trigger with the same interval even if the computers CPU varies..
-
Jul 9th, 2001, 09:06 AM
#3
-= B u g S l a y e r =-
eh.. that came out a bit wrong.. dont't think that one computers cpu will vary that much... but you get my point ?
-
Jul 9th, 2001, 09:10 AM
#4
Frenzied Member
Yep! makes sense to me
this uses a picture box and a menu item called mnuX
Code:
Option Explicit
Private Sub Form_Load()
Picture1.Left = 0
Picture1.Width = Me.ScaleWidth
End Sub
Private Sub mnuX_Click()
If mnuX.Caption = "hide" Then
hidePic
mnuX.Caption = "show"
Else
showPic
mnuX.Caption = "hide"
End If
End Sub
Private Sub Pause(secs As Single)
Dim sngStopVal As Single
sngStopVal = Timer + secs
While sngStopVal > Timer
DoEvents
Wend
End Sub
Private Sub showPic()
While Picture1.Top > Me.ScaleHeight - Picture1.Height
Picture1.Top = Picture1.Top - 100
Pause 0.01
Wend
End Sub
Private Sub hidePic()
While Picture1.Top < Me.Height
Picture1.Top = Picture1.Top + 100
Pause 0.01
Wend
End Sub
-
Jul 9th, 2001, 09:12 AM
#5
Thread Starter
Member
While it's not essential to all life on Earth, but will the code produce animation that runs smoother on faster machines and crappier on slower machines?
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
|