We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can Clock control be used as a Countdown Clock

Thread ID:

Created:

Updated:

Platform:

Replies:

129017 Feb 21,2017 10:01 PM UTC Feb 27,2017 01:00 PM UTC WinForms 3
loading
Tags: Clock
Stan Laffrey
Asked On February 21, 2017 10:01 PM UTC


Can the Windows Forms Clock control be used as a countdown clock?

Kannan R [Syncfusion]
Replied On February 22, 2017 06:18 AM UTC

Hi Stan,   
   
Thank you for contacting Syncfusion Support.    
   
Yes, Syncfusion Clock control can be used as Count Clock, and this can be achieved by using its properties named “StopTimer”, “CustomTime”, and “ShowCustomTimeClock”. Please make use of the below code snippet to achieve your requirement.   
   
Code Snippet: [C#]   
   
   
//To show the custom time   
this.clock1.ShowCustomTimeClock = true;   
// To hide Dates in Digital Clock   
this.clock1.DisplayDates = false;   
//To set the Custom time / Reset the clock   
this.clock1.CustomTime = new DateTime();   
// To Freeze and Un Freeze the Clock   
this.clock1.StopTimer = true;   
   
 
Screenshot   
   
   
   
We have also prepared a sample for your reference, and it can be downloaded from:   
 
   
Kindly check the above solution and let us know if it was helpful.   
   
Regards   
Kannan   
 


Stan Laffrey
Replied On February 22, 2017 03:19 PM UTC

Thanks Kannan!  Is there a way to make the clock count down instead of up?  (e.g., 10....9.....8.....)

Kannan R [Syncfusion]
Replied On February 27, 2017 01:00 PM UTC

Hi Stan,    
    
Thank you for contacting Syncfusion Support.     
    
Yes, this reported requirement can be achieved by using its properties named “StopTimer”, “CustomTime”, and using Timer. Please make use of the below code snippet to achieve your requirement.    
    
Code Snippet: [C#]    
    
 
         void CountDownTimer_Tick(object sender, EventArgs e) 
        { 
            if ((this.clock1.CustomTime.Second - 1) > 0) 
            { 
                this.clock1.CustomTime = this.clock1.CustomTime.AddSeconds(-1); 
                this.clock2.CustomTime = this.clock1.CustomTime.AddSeconds(-1); 
            } 
            else 
            { 
                this.clock1.CustomTime = new DateTime(); 
                this.clock2.CustomTime = new DateTime(); 
                this.CountDownTimer.Stop(); 
                this.buttonAdv1.Text = "Reset the Clock"; 
            } 
        } 
 
  
Screenshot    
    
    
    
We have also prepared a sample for your reference, and it can be downloaded from:    
  
    
Kindly check the above solution and let us know if it was helpful.    
    
Regards    
Kannan    
  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;