我写了一个winform程序,这是二级窗口的时间显示代码,我想让时间显示在状态栏上,但不知道为什么,运行以后没有反应,这是我的窗口代码
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 admin1 : Form
{
public admin1()
{
InitializeComponent();
}
private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{
}
private void admin1_Load(object sender, EventArgs e)
{
this.toolStripStatusLabel1.Text = "本次登录时间戳为:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void toolStripStatusLabel1_Click_1(object sender, EventArgs e)
{
}
}
}