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 WindowsFormsApplication2
{
public partial class Form1 : Form
{
int i=0,j=0;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
i++;
i = i % 4;
label1.Text = Convert.ToString(i);
j++;
j = j % 4;
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;
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
沒有留言:
張貼留言