表格加载winforms [英] form loadin winforms

查看:76
本文介绍了表格加载winforms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





在我的应用程序中,当表单加载时,我需要在当前日期和时间填充文本框。



i使用以下内容:

  private   void  VisitorOut_Load( object  sender,EventArgs e)
{
String outdatetime = System.DateTime.Now.ToString( yyyy-MM-dd HH:mm:ss);
txtVisitorOutTime.Text = outdatetime;
txtVisitorOutTime.Enabled = false ;
}





此表格是从另一个表格按钮点击打开的。当我第一次点击按钮时给出正确的日期和时间,但如果我通过点击另一个表格中的按钮第二次打开,它只提供以前的数据和时间,如何解决它。





任何想法........

解决方案

仅回复从活动列表中删除 - 由OP解决。

Hi,

In my application , when form loaded ,at that time i need to fill the textbox with current date and time.

i used the following:

private void VisitorOut_Load(object sender, EventArgs e)
    {
     String outdatetime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     txtVisitorOutTime.Text = outdatetime;
     txtVisitorOutTime.Enabled = false;
    }



this form is opened from another form button click.when i click the button first time it's giving correct date and time, but if i open in second time by clicking the button from another form,it's giving previous data and time only, how to solve it.


any idea........

解决方案

Answered only to remove from active list - solved by OP.


这篇关于表格加载winforms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆