夜光序言:
今天再精彩,也会拼凑成明天的历史,我们再执着,也拒绝不了岁月赋予的伤痕。
正文:
我们先把准备工作做做好
这样就有了恩
所有可以加图片的控件,我们都可以设置
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Timer1_Tick(object sender, EventArgs e)
{
//在label1中显示当前时间
lblTime.Text = DateTime.Now.ToLongTimeString();
}
private void Form1_Load(object sender, EventArgs e)
{
//窗体加载时启动timer1这个控件
timer1.Start();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Timer1_Tick(object sender, EventArgs e)
{
//在label1中显示当前时间
lblTime.Text = DateTime.Now.ToLongTimeString();
}
private void Form1_Load(object sender, EventArgs e)
{
//窗体加载时启动timer1这个控件
timer1.Start();
}
private void Button1_Click(object sender, EventArgs e)
{
timer1.Stop();
}
}
}
点击字体就会出现选择的界面