如何在c#中是现在状态栏中显示时间、日期? 将下面的放在一个timer事件函数中:System.DateTime.Now.ToLongDateString();//日期字符串System.DateTime.Now.ToLongTimeString();//时间字符串 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this.statusBarPanel2.Text = DateTime.Now.ToLongDateString(); 你加一个statusbar,然后加入几个小的Panels,把showpanels设置为true! using system.Datestring str= DateTime.Now.ToShortDateString();你会看到你的str= '2003-7-11' 加timer与statusBar控件,name分别为timer1与statusBar1考虑使用下面代码:private void Form1_Load(object sender, System.EventArgs e){ timer1.Enabled=true; timer1.Interval=1000; //时间间隔为1秒}private void timer1_Tick(object sender, System.EventArgs e){ this.statusBar1.Text="现在是:" + System.DateTime.Now.ToString(); this.statusBar1.Refresh();} 两个pannel,分别是加入当天的日期和即时的时间显示。我明天试试,先在这儿感谢大家了! 请问代码应该加在timer事件函数中的那个位置?在main()中应该怎么调用? 无论我把代码加到哪里pannel的text属性好像没办法修改~~ 想做一个小工具 vb.net改成c# 请好人帮忙 我想了解一下vs2005 Oracle数据库的数据库查询 更新 插入 删除 等操作的一些语句 SharpDevelop的朋友请进 窗体加载失败!!! e.cancell 后怎么推出程序 新手求助%>_<%!窗体嵌入功能 我在.NET开发时网页上传服务器后因为传的参数里包含了xml,但是我按照网上说的方法配置了config却还是报那个错 WebBrowser登录微信网页发消息,发送消息时,提示“字数需在1-600之间” C# 如何使用SFTP 上传文件并支持断点续传 两个xml问题 ***Java里zip压缩类,.NET里有类似的吗?***
你会看到你的str= '2003-7-11'
考虑使用下面代码:
private void Form1_Load(object sender, System.EventArgs e)
{
timer1.Enabled=true;
timer1.Interval=1000; //时间间隔为1秒
}private void timer1_Tick(object sender, System.EventArgs e)
{
this.statusBar1.Text="现在是:" + System.DateTime.Now.ToString();
this.statusBar1.Refresh();
}
在main()中应该怎么调用?