Results 1 to 2 of 2

Thread: Animation

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Europa
    Posts
    7

    Exclamation

    How can I place an animation on my form?
    I don't know very much about VB

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    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...

    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
    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.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width