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

  • Home
  • SEARCH
  • 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 9212999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:38:58+00:00 2026-06-18T01:38:58+00:00

I want my ProgressBar starting in some point in my code and run total

  • 0

I want my ProgressBar starting in some point in my code and run total of seconds until my file finish, and of course I know how long the run of my file will take.
I try to read on MSDN but I did not understood how to use it.

My application run files (wireshark file, send the packet using bittwist) and each file will run few seconds and I want the option to see the progress ongoing.

For example I want to set my ProgressBar running for 30 seconds.
How can I do it?

  • 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-18T01:38:59+00:00Added an answer on June 18, 2026 at 1:38 am

    Maybe you want something like this:

    public void AnimateProgBar (int milliSeconds)
    {
        if (!timer1.Enabled)  {
            progressBar1.Value = 0;
            timer1.Interval = milliSeconds / 100;
            timer1.Enabled = true;
        }
    }
    
    private void timer1_Tick(object sender, EventArgs e)
    {
        if (progressBar1.Value < 100) {
            progressBar1.Value += 1;
            progressBar1.Refresh();
        } else {
            timer1.Enabled = false;
        }
    }
    

    Then you just have to call AnimateProgBar(2000) to have your ProgressBar animated during 2 seconds.

    EDIT: Sorry, I posted code in VB.NET. Modified to C#.
    EDIT: You can add the handler and call the function in this way (for example):

        private void Form1_Load(object sender, EventArgs e)
        {
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            AnimateProgBar(2000);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when I download file i want progressbar sync with this. but not, my code
I want a progressbar to be visible until a download is finished. In order
I simply want a nondeterministic progressbar that becomes visible and shows some activity to
I want the progressbar to increase when it matches a string. Like if I
I want to implement a progress bar showing elapsed seconds in bash. For this,
I want to handle click on ProgressBar like on slider. and learn a percent
I want to show my application user a progressbar for following actions: when they
How to use ProgressBar for SaveToFile method ? Actually I want to save a
We've all used the ProgressBar control, and it's great. Sometimes, though, you want to
I want to do some stuff. I wanna do lazy loading in ListView .

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.