namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
int n = 0;
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
Bitmap pit1 = new Bitmap(@"C:\Users\Maysfolo\Pictures\青蛙\1.jpg");
Bitmap pit2 = new Bitmap(@"C:\Users\Public\Pictures\Sample Pictures\蘑菇maysfolo.jpg");
Bitmap pit3 = new Bitmap(@"C:\Users\Public\Pictures\Sample Pictures\2.jpg");
Bitmap pit4 = new Bitmap(@"C:\Users\Public\Pictures\Sample Pictures\3.jpg");
Bitmap pit5 = new Bitmap(@"C:\Users\Maysfolo\Pictures\青蛙\2.png");
switch (n)
{
case 0: pictureBox1.Image = pit1; n = n + 1; break;
case 1: pictureBox1.Image = pit2; n = n + 1; break;
case 2: pictureBox1.Image = pit3; n = n + 1; break;
case 3: pictureBox1.Image = pit4; n = n + 1; break;
case 4: pictureBox1.Image = pit5; n = 0; break;
default: MessageBox.Show ("error"); break;
}
}
}
}