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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:04:44+00:00 2026-06-18T06:04:44+00:00

I have a Windows.Forms.Timer used in a form that works if I set its

  • 0

I have a Windows.Forms.Timer used in a form that works if I set its Enabled property to true in the properties window, and that is the only time it works. If I leave it disabled then enable it only when I need to, it doesn’t tick.

        private void btnRename_Click(object sender, EventArgs e)
        {
            timerUpdateProgress.Enabled = true;
            timerUpdateProgress.Start();
            pbProgress.Maximum = clbFiles.CheckedItems.Count;
            var renameTask = Task.Factory.StartNew(() => doRename(true, tbCurrentDirectory.Text, clbFiles.CheckedItems, rules));
            if(renameTask.Result.Count > 0)
            {
                timerUpdateProgress.Enabled = false;
                new ExceptionsWindow(renameTask.Result).ShowDialog();
            }
            timerUpdateProgress.Enabled = false;
            loadFiles(tbCurrentDirectory.Text);
        }

        private void timerUpdateProgress_Tick(object sender, EventArgs e)
        {
            pbProgress.Value = progress; //I have a breakpoint on this line
        }

All I’m trying to do is display the progress of an operation with a progress bar. Enabling and starting the timer does nothing, the tick never happens. Why is this happening?

Update: stepping through the code after adding a sleep of 2000ms after enabling and starting the timer shows it still does not tick (I have a breakpoint in the tick handler).

More clarification: When the timer is enabled in the property window, the tick handler is always being called, and that’s without calling Start(). My breakpoint is triggered all the time just by enabling the timer. I should also note that I’m using .NET 4.

  • 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-18T06:04:46+00:00Added an answer on June 18, 2026 at 6:04 am

    EDIT:
    After getting an idea from the comments – it seems you do not need the timer at all.

    You can update the progress bar Value as and when the value of progress is updated.

    That way the transition from 0 – 100% might also seem smoother.


    According to me you need disable the timer.

    Just use

    timer.Stop();
    

    And then timer.Start() when needed again.

    Additionally, if you have disabled timer progress, then you also must do

    timerUpdateProgress.Enabled = true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one windows form file that each time I open it in Visual
I have Windows Forms UI, that allows me to enter format for string formatting
I have a windows forms client that consumes an ASP.net web service. It's my
I have a windows forms application in .NET 3.5. There's one form with 20
I have a Windows Forms project in Visual Studio that reads configuration files from
I have a windows forms application that reads and updates an XML file with
I have a C# windows forms application. The way I currently have it set
I have a windows form application which needs to be the TopMost. I've set
I have a base form that I use when calling 2 forms. Previously when
I have a three-tier Windows Forms DB application in VB.NET. I'm using VS 2005.

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.