C#状态栏控件使用介绍
				
									
					
					
						 | 
						
							
							admin 
							
							
								2025年4月14日 19:8
								本文热度 1543
							
							 
						 | 
					
					
				 
				
Interval属性设置为1000,即每隔1s刷新一次。将显示时间代码写在窗体Load事件中,即运行时执行;并将刷新事件的代码写在Timer_Tick事件中,则每隔Interval设置的时间执行一次。namespace _002_状态栏{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }
        private void Form1_Load(object sender, EventArgs e)        {            this.lblTime.Text = string.Format(DateTime.Now.ToString());        }
        private void timer_Tick(object sender, EventArgs e)        {            this.lblTime.Text = string.Format(DateTime.Now.ToString());        }    }}
阅读原文:原文链接
该文章在 2025/4/15 14:56:11 编辑过