Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WinForm
private void CountdownTimer_Load(object sender, EventArgs e)
        {
            Timer MyTimer = new Timer();
            MyTimer.Interval = (20 * 60 * 1000); // 20 mins
            MyTimer.Tick += new EventHandler(MyTimer_Tick);
            MyTimer.Start();
        }
 
        private void MyTimer_Tick(object sender, EventArgs e)
        {
            MessageBox.Show("time is up");
            this.Close();
        }
 
Timer MyTimer = new Timer();
 
so i need to Display Remaining Time Like Minutes:Seconds Like this How can i
Posted 9-Dec-12 19:02pm
Edited 9-Dec-12 19:04pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Use the Timer with a TimeSpan. This example on msdn - http://msdn.microsoft.com/en-us/library/aa332426%28v=vs.71%29.aspx[^] should really help you get started.
  Permalink  
Comments
leaderbalaji at 10-Dec-12 1:38am
   
is there any simple way
Abhinav S at 10-Dec-12 2:09am
   
Honestly, I dont think there is any simpler accurate way to do this.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 271
1 OriginalGriff 253
2 nv3 60
3 Mehdi Gholam 45
4 VJ Reddy 45
0 Sergey Alexandrovich Kryukov 6,696
1 OriginalGriff 6,149
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 10 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100