Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. ProgressBar on long processes

ProgressBar on long processes

Scheduled Pinned Locked Moved C#
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tim DuBois
    wrote on last edited by
    #1

    I'm not too sure how to say what I would like consisely but here goes: If my program is doing a somewhat cpu intensive process, I would like a threaded progressbar to come up, and give an intication of how long the process will take, then once finished hide itself again and the program continues. I can make the progressbar already, as well as thread it. All I want to know is how to invoke it. ie how to find out if the process I'm running warrants the bar or not. Any ideas?

    D 1 Reply Last reply
    0
    • T Tim DuBois

      I'm not too sure how to say what I would like consisely but here goes: If my program is doing a somewhat cpu intensive process, I would like a threaded progressbar to come up, and give an intication of how long the process will take, then once finished hide itself again and the program continues. I can make the progressbar already, as well as thread it. All I want to know is how to invoke it. ie how to find out if the process I'm running warrants the bar or not. Any ideas?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      That would depend on the process your running, and would normally be determined by the process, not the part that launched it. The process would have to be able to determine the amount of data that must be processed AND track where it is currently. For example, searching through an unknown number of files would not lend itself to a progress bar because you can't determine when the progress is going to end. But searching through a known number of files will. All you have to do is keep track of the number of files you've searched through. The process would also have to implement a timer where if the process is still running after say, 3 seconds, the timer would set a flag that shows a dialog with the current progress information. This progress tracking would be running regardless if the dialog was showing or not. The timer is only there to flip on the display of the progress, not to start it. If you're trying to track the progress of a component you didn't right, there is not much you can do to implement the progress bar. Your component must be able to tell you how much processing must be done and how far along it's gotten. It must also be able to fire off events on some condition that lets you know progress is being made. If you component doesn't give you any kind of information like this, your SOL. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups