int i = 0;
pictureBox1.Image = Image.FromFile(Application .StartupPath + "//images//" + pics[0]);
private void timer1_Tick(object sender, EventArgs e) { //'Set this formula to increment i by 1 i += 1; //'Set a validation of pictures if(pics.Length == i) { i = 0; } //'Set to Load the image. pictureBox1.Image = Image.FromFile(Application.StartupPath + "//images//" + pics[i]); }
private void button2_Click(object sender, EventArgs e) { //'Disable timer to prevent the next image from loading.. timer1.Enabled = false; //'Set this formula to increment i by 1 i += 1; //'Set a validation of pictures if( pics.Length == i) { i = 0; } //'Set to Load the image. pictureBox1.Image = Image.FromFile(Application.StartupPath + "//images//" + pics[i]); //'Re-Enable timer to resets the image loads in 5 seconds.. timer1.Enabled = true; timer1.Interval = 5000; }
private void button1_Click(object sender, EventArgs e) { //'Disable timer to prevent the next image from loading.. timer1.Enabled = false; //'Set this formula to increment i by 1 i -= 1; //'Set a validation of pictures if (pics.Length == i) { i = 0; } //'Set to Load the image. pictureBox1.Image = Image.FromFile(Application.StartupPath + "//images//" + pics[i]); //'Re-Enable timer to resets the image loads in 5 seconds.. timer1.Enabled = true; timer1.Interval = 5000; }