<img src="https://img-blog.youkuaiyun.com/20141023151840254?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMjM2OTE3NQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />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 void button1_Click(object sender, EventArgs e)
{
DateTime date = DateTime.Now;
label1.Text = date.ToString();
}
private void Form1_Load(object sender, EventArgs e)
{
button1.Text = "单击该按钮显示系统当前时间";
}
private void label1_Click(object sender, EventArgs e)
{
}
}
}
在该窗体上,放置一个按钮、一个标签。单击按钮时,在标签上显示当前系统时间。
最新推荐文章于 2022-07-18 00:00:56 发布