Click here to Skip to main content
12,450,981 members (52,245 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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
Updated 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 10-Dec-12 1:38am
   
is there any simple way
Abhinav S 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 10 Dec 2012
Copyright © CodeProject, 1999-2016
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