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. Threads and ProgressBar

Threads and ProgressBar

Scheduled Pinned Locked Moved C#
helplinuxquestion
3 Posts 3 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.
  • A Offline
    A Offline
    achrafus
    wrote on last edited by
    #1

    Hi, my problem comes from the fact that I'm trying to make my progressbar progress while I'm scanning directory files.the awk thing is that my scan function is defined within my datalayer as a dll.I want my progress bar to follow the files processing. I first thought about threads but could'nt move on.probably got allergy for threads.can anybody help? thanks in advance

    E M 2 Replies Last reply
    0
    • A achrafus

      Hi, my problem comes from the fact that I'm trying to make my progressbar progress while I'm scanning directory files.the awk thing is that my scan function is defined within my datalayer as a dll.I want my progress bar to follow the files processing. I first thought about threads but could'nt move on.probably got allergy for threads.can anybody help? thanks in advance

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      If you have "access" to the source of the datalayer dll you could create some events. You can trap these events in your app then, like what the WebBrowser does with it's DocumentProgress (or something like that) event. Ed

      1 Reply Last reply
      0
      • A achrafus

        Hi, my problem comes from the fact that I'm trying to make my progressbar progress while I'm scanning directory files.the awk thing is that my scan function is defined within my datalayer as a dll.I want my progress bar to follow the files processing. I first thought about threads but could'nt move on.probably got allergy for threads.can anybody help? thanks in advance

        M Offline
        M Offline
        mikanu
        wrote on last edited by
        #3

        Your problem seems to be a perfect candidate for the BackgroundWroker thread control that's newly available in the .NET 2.0 framework. Using this controll is rather pain free. It's literally a matter of a few click to get yourself set up with a background worker thread that is going ot perform the scan in background for you. The way you use this control is you have to provide three functions to handle three events. One is the actual worker function (this will be the function that scans the files). Then There is a function that will be called when the progress changes. And the last one is going to be a function that will be called when the thread ahs finished processing. So in the actual worker function you will need to call the ReportProgress function that will basically marshal your call and eventually fire the second event (the progress changed event) on the appropriate thread. It's that easy. Feel free to google for the BackgroundWorkerThread samples online Good luck Mikk ---- www.muzikstor.com

        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