using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int i;
int j;
public Form1()
{
InitializeComponent();
i=0;
j = 0;
}
private void timer1_Tick(object sender, EventArgs e)
{
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
i++;
i = i % 6;
label1.Text = Convert.ToString(i);
j++;
j=j%6;
switch(j)
{
case 0:
button1.Enabled=true;
button2.Enabled = false;
button3.Enabled = false;
break;
case 1:
button1.Enabled = false;
button2.Enabled=true;
button3.Enabled = false;
break;
case 2:
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled=true;
break;
case 3:
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = true;
break;
case 4:
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = true;
break;
case 5:
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = true;
break;
}
}
private void label1_Click(object sender, EventArgs e)
{
}
}
}
沒有留言:
張貼留言