[問題] 關於這個switch迴圈
private void timer1_Tick(object sender, EventArgs e)
{
switch (counter)
{
case 1:
pictureBox2.Visible = false;
pictureBox1.Visible = pictureBox3.Visible = true;
pictureBox5.Visible = false;
pictureBox4.Visible = pictureBox6.Visible = true;
break;
case 2:
pictureBox2.Visible = false;
pictureBox3.Visible = pictureBox3.Visible = true;
pictureBox6.Visible = false;
pictureBox4.Visible = pictureBox1.Visible = true;
break;
default:
counter = (counter + 1) % 3;
}
出現以下錯誤
-----> 程式執行無法從 case 標籤 ('default:')繼續到下一個
在default敘述式後加入break; 就可以跑了,但是執行一次case1就不繼續跑了
問題出在哪?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 192.192.154.49
→
05/14 16:50, , 1F
05/14 16:50, 1F
→
05/14 16:53, , 2F
05/14 16:53, 2F
→
05/14 17:26, , 3F
05/14 17:26, 3F
→
05/14 17:36, , 4F
05/14 17:36, 4F
→
05/14 17:37, , 5F
05/14 17:37, 5F
→
05/14 18:23, , 6F
05/14 18:23, 6F
→
05/14 18:24, , 7F
05/14 18:24, 7F
→
05/14 21:33, , 8F
05/14 21:33, 8F
→
05/14 23:09, , 9F
05/14 23:09, 9F
→
05/14 23:10, , 10F
05/14 23:10, 10F
→
05/14 23:12, , 11F
05/14 23:12, 11F
推
05/21 01:14, , 12F
05/21 01:14, 12F