int a = 0;
private void button1_Click(object sender, EventArgs e)
{
Bitmap picture1 = new Bitmap(@"d:\My Documents\My Pictures\713f7dd3jw1duqksh838ej.jpg");
Bitmap picture2 = new Bitmap(@"d:\My Documents\My Pictures\0680e_ozpR0h.jpg");
Bitmap picture3 = new Bitmap(@"d:\My Documents\My Pictures\52339a2b8a2fa47e5243c17b.jpg");
Bitmap picture4 = new Bitmap(@"d:\My Documents\My Pictures\174409eill5mldx5dllszi.jpg");
Bitmap picture5 = new Bitmap(@"d:\My Documents\My Pictures\919_1537872_fea0d9f8d17b3f7.jpg");
switch (a)
{
case 0: pictureBox1.Image = picture1; a = a + 1; break;
case 1: pictureBox1.Image = picture2; a = a + 1; break;
case 2: pictureBox1.Image = picture3; a = a + 1; break;
case 3: pictureBox1.Image = picture4; a = a + 1; break;
case 4: pictureBox1.Image = picture5; a = a + 1; break;
case 5: pictureBox1.Image = picture1; a = a + 1; if (a > 5) a = 1; break;
}
}
}
}
果然还是函数好用