How can I place an animation on my form?
Printable View
How can I place an animation on my form?
If it's an animated GIF then you need the AnimGIF control, but if it's a series of bitmaps, load them into an array of pictureboxes at runtime. Make another picturebox and add a timer...
What this code does is increment A every time the timer triggers, causing the animation frame to go up one. If the frame number is too high then it sets it to 0, and then it displays it in the picturebox.Code:Option Explicit
Dim A as Integer
Private Sub Form_Load()
A = 0
End Sub
Private Sub Timer1_Timer()
A = A + 1
If A > Ubound(Picture1) Then A = 0
Picture2.Picture = Picture1(A).Picture
End Sub