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 7055191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:43:07+00:00 2026-05-28T03:43:07+00:00

Timers.Timer to create StopWatch. I use Timer.Elapsed to handle event that display time after

  • 0

Timers.Timer to create StopWatch. I use Timer.Elapsed to handle event that display time after perticular time. I give timer interval of 1 and enabled to true. I also make AutoReset to true. But the problem is event is firing only once.and I get time in Textbox only once.How can I change Time in TextBox Every Second.I try all alternatives but not get success…Thank You

    System.Timers.Timer StopWatchTimer = new System.Timers.Timer();
    Stopwatch sw = new Stopwatch();
     public void StopwatchStartBtn_Click(object sender, ImageClickEventArgs e)
    {

        StopWatchTimer.Start();
        StopWatchTimer.Interval = 1;
        StopWatchTimer.Enabled = true;
        StopWatchTimer.AutoReset =true; 
        sw.Start();
        StopWatchTimer.Elapsed += new System.Timers.ElapsedEventHandler(StopWatchTimer_Tick);
    }

    protected void StopWatchStopBtn_Click(object sender, ImageClickEventArgs e)
    {

        TextBoxStopWatch.Text = "00:00:000";
        StopWatchTimer.Stop();
        sw.Reset();
        sw.Stop(); 

    }

    public void StopWatchTimer_Tick(object sender,EventArgs e)
    {           
   TextBoxStopWatch.Text=   Convert.ToString(sw.Elapsed);
    }

UPDATE:
I try it by creating new website in Visual Studio.But still don’t get success.same problem . Now update is when I set Break Point in Line

     TextBoxStopWatch.Text=   Convert.ToString(sw.Elapsed);

Text is Continuously changing there but not displaying in TextBox. Hope You can Understand this.

  • 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-05-28T03:43:08+00:00Added an answer on May 28, 2026 at 3:43 am

    You can’t do it this way in a web page.

    By the time the page is rendered, the server is done and the client has disconnected. It’s not going to get any more updates from your timer.

    If you need to have a timer on the page itself showing some changing numbers then you will have to do this via javascript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the System.Timers.Timer class to create a timer with an Timer.Elapsed event. The
which is the right approach to use a System.Timers.Timer? I mean... I create the
I need to create an interval Timer that is set to run once a
I want to create an incrementing second timer like a stopwatch. So I want
I want to create a class that initializes a timer which will be used
I'm looking for a repeating timer object that allows me to create it once
Consider this code: PS> $timer = New-Object Timers.Timer PS> $timer.Interval = 1000 PS> $i
I'm trying to create a simple flex4 project which involves some timers that trigger
I have a windows service that calls a page after a certain interval of
We have an API that handles event timers. This API says that it uses

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.