Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8150349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:02:38+00:00 2026-06-06T15:02:38+00:00

I want to make a Windows Form Application which only shows a timer as:

  • 0

I want to make a Windows Form Application which only shows a timer as:

xx days
xx hours
xx minutes
xx seconds

  • No option for setting the timer or anything, i want to do that in the code
    However, the problem is i want it to count down from current time (DateTime.Now)
    to a specific date. So i end up with the time left as TimeSpan type. I’m now in doubt how to actually display this, so it’s actually working, and updating (counting down)
    Can’t seem to find a tutorial that helps me, so i hope i may be able to get some help here 🙂
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:02:40+00:00Added an answer on June 6, 2026 at 3:02 pm

    You can use a timespan format string and a timer:

    DateTime endTime = new DateTime(2013,01,01,0,0,0);
    private void button1_Click(object sender, EventArgs e)
    { 
        Timer t = new Timer();
        t.Interval = 500;
        t.Tick +=new EventHandler(t_Tick);
        TimeSpan ts = endTime.Subtract(DateTime.Now);
        label1.Text = ts.ToString("d' Days 'h' Hours 'm' Minutes 's' Seconds'");
        t.Start();
    }
    
    void  t_Tick(object sender, EventArgs e)
    {
        TimeSpan ts = endTime.Subtract(DateTime.Now);
        label1.Text = ts.ToString("d' Days 'h' Hours 'm' Minutes 's' Seconds'");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a System.Windows.Forms.Timer component on an application's main form which checks every
I want to make a windows form application and want to use windows authentication
In My windows form application I want to make the title of the form
I want to make a form like this in windows forms. To make a
I want to make a Windows application in ansi C but I am having
I'm creating a database application using ASP.NET and I want to make a Windows
I want to make an easy to deploy Windows application and was was wondering
How can I make my already running C# Windows Form Application be able to
I am working in C# Windows Forms Application I want to make shadow of
How to make semi transparent form in C# windows form application I have tried

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.