Revolving Progress Bar during long operation...

Posted on 2006-06-07
Last Modified: 2008-01-09
I'm working on a Windows Forms project written in C# (.Net 2.0 - Visual Studio 2005) and I'm stuck on what seems like it should be a trivial task.  I have a form that allows the user to select certain values and then these values are used to query a database and write the results to a CSV file.  All of the information processing takes place in a separate thread from the UI and I would like to have something that shows that the program is doing work.

What I envision is a Progress Bar marquee that just "revolves" until the processing stops.  Any kind of graphic really that just spins or rotates or whatever just so that something is graphically moving on the main form while the work is being done.  I assume that the Progress Bar control would be the easiest to implement even though I don't really want to show the "Progress" of the program, I just want something that looks pretty and lets the user know that something is still happening.

Do I need to create a separate thread that has no purpose other than to change value of the ProgessBar so that it remains animated while the Program is running?  It seems like there should be a better (easier?) way.

Thanks in advance.
Question by:naj2576
    LVL 11

    Accepted Solution

    you just have to use the NEW style property of the progressbar.
    use the Marquee style, thats what you need i think.
    progressBar1.Style = ProgressBarStyle.Marquee;

    Author Comment

    Thanks for the help.  I can't believe I missed that.  I knew I was trying to make it too complicated.
    LVL 11

    Expert Comment

    you're welcome. that is to my opinion one of the greatest control updates except for the strip things of net2.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now