程式設計工藝大師
應數物件導向設計C#
d0250713 邱建理
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
int c=0,d=0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
c = c + 1;
d = c % 3;
if (d == 1)
{
button1.BackColor = System.Drawing.Color.Red;
button2.BackColor = System.Drawing.Color.Black;
button3.BackColor = System.Drawing.Color.Black;
}
else if (d==2)
{
button2.BackColor = System.Drawing.Color.Yellow;
button1.BackColor = System.Drawing.Color.Black;
button3.BackColor = System.Drawing.Color.Black;
}
else if(d==0)
{ button3.BackColor = System.Drawing.Color.Green;
button2.BackColor = System.Drawing.Color.Black;
button1.BackColor = System.Drawing.Color.Black;
button1.Text = c.ToString();
}
}
private void button3_Click(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}
沒有留言:
張貼留言