Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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:
C#
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........
Posted
Updated 15-Apr-14 23:29pm
v2
Comments
Member 10263519 16-Apr-14 5:31am    
ok, solved it by keeping it in button click,

1 solution

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900