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 CHill60 360
1 OriginalGriff 303
2 Sarvesh Kumar Gupta 168
3 RyanDev 145
4 Sergey Alexandrovich Kryukov 128


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