heyz... i need help. i new to C#. i need to add timer to my code. but i don't know how to do it... can help mi!! all i have done to the code is declared int time. :(:(
Baby G 0 Newbie Poster
Recommended Answers
Jump to PostWelcome Baby G
Drop a Label onto the Form and write following code in Form Load event
private void Form1_Load(object sender, EventArgs e) { Timer timer = new Timer(); timer.Interval = 1000; //1sec timer.Tick+=(sa,ea)=> { label1.Text = DateTime.Now.ToString(); }; timer.Start(); }
Jump to PostSuggest you read a good book about VS and C#.
All 8 Replies
sandeepparekh9 109 Posting Whiz
Baby G 0 Newbie Poster
Mitja Bonca 557 Nearly a Posting Maven
kvprajapati 1,826 Posting Genius Team Colleague
Baby G 0 Newbie Poster
kvprajapati 1,826 Posting Genius Team Colleague
ddanbe 2,724 Professional Procrastinator Featured Poster
Baby G 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.