Form Animation?

I want to have a form that has 4 pictureboxes and steps thru the pictures (loops so it looks like animation) using a timer control, any suggestions on how to do this? I'm using VB express
Thanks,
Jerry

Comments

  • seancampbellseancampbell Pennsylvania, USA
    VB Express? I am not sure about that... but I will tell you how to do it...

    Make a form level variable called PicCount as Integer.

    In your Form_Load function set:
    [code]
    Timer1.Interval = 10 (10 miliseconds)
    PicCount = 0
    Timer1.Enabled = True
    [/code]

    In your Timer code, put in this:
    [code]
    Select Case PicCount
    Case 0:
    Dim bmp As New Bitmap("C:imagespicture.bmp")
    PictureBox1.Image = Bmp
    PicCount = 1
    Case 1:
    Dim bmp As New Bitmap("C:imagespicture2.bmp")
    PictureBox1.Image = Bmp
    PicCount = 2
    Case 2:
    Dim bmp As New Bitmap("C:imagespicture3.bmp")
    PictureBox1.Image = Bmp
    PicCount = 0
    End Select
    [/code]

    Hope this helps, there may be a better way to do it, but I don't know.
  • : VB Express? I am not sure about that... but I will tell you how to
    : do it...
    :
    : Make a form level variable called PicCount as Integer.
    :
    : In your Form_Load function set:
    : [code]:
    : Timer1.Interval = 10 (10 miliseconds)
    : PicCount = 0
    : Timer1.Enabled = True
    : [/code]:
    :
    : In your Timer code, put in this:
    : [code]:
    : Select Case PicCount


    Thanks that works
    : Case 0:
    : Dim bmp As New Bitmap("C:imagespicture.bmp")
    : PictureBox1.Image = Bmp
    : PicCount = 1
    : Case 1:
    : Dim bmp As New Bitmap("C:imagespicture2.bmp")
    : PictureBox1.Image = Bmp
    : PicCount = 2
    : Case 2:
    : Dim bmp As New Bitmap("C:imagespicture3.bmp")
    : PictureBox1.Image = Bmp
    : PicCount = 0
    : End Select
    : [/code]:
    :
    : Hope this helps, there may be a better way to do it, but I don't
    : know.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories