I am trying to setup a picturebox that will display a total of 5 images in a sequence to look like animation. I am getting one error in regard to the following;
"A first chance exception of type 'System.ArgumentOutOfRange
occurred in System.Windows.Forms.dll"
Don't know why. I've loaded the images and tried setting the # of images @ 0, 3, & 5, but still get the error no matter what the #. I also need two buttons, one to be able to speed up the images in the picturebox and one to speed down the images in the picturebox.
Here is the code I am using. Please be very specific. I am new to programming and really need this completed by today as it is a test my work is putting me through.
Public Class Form1
' A form level variable to hold which frames is to show which image
' It has to be form level so that our timer1_tick event
Dim imageNumber As Integer = 0
Private Sub MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles MenuStrip1.ItemClicked
' Our form load even just sets the pictureboxe's image
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox1.Image = ImageList1.Images(0)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Image = ImageList1.Images(Imagenumber)
Imagenumber = Imagenumber + 1
If Imagenumber > ImageList1.Images.Count - 1 Then
Imagenumber = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Timer1.Enabled Then