2012-03-20
時間
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
{
public Form1()
{
InitializeComponent();
}
private DateTime data;
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = "";
label1.Font = new Font("標楷體", 24, FontStyle.Bold);
timer1.Interval = 500;
data = new DateTime(2012, 1, 1);
this.Text = data.Year.ToString();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = data.Month + "月" + data.Day + "日";
data = data.AddDays(1);
}
}
}
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言