Results 1 to 7 of 7

Thread: Need Simple Async/Await Progress Bar Example

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2014
    Posts
    12

    Need Simple Async/Await Progress Bar Example

    I've found multiple examples of using Async/Await, but they are either using web page downloading or file downloading as the asynchronous or blocking method being called. In the examples the progress bar is then called and updated for each string (or object returned) from the web page or complete file returned. I am trying to call a method that takes ~5 seconds to execute and while this is occurring, be separately updating a progress bar on ~0.5 second intervals. Can anyone steer me in the direction where I could find a similar example?

  2. #2
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Need Simple Async/Await Progress Bar Example

    You should use multi threading for this instead. Just use a thread pool instead.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2014
    Posts
    12

    Re: Need Simple Async/Await Progress Bar Example

    Thank you for the suggestion. I had first considered using a separate thread or helper function, but subsequent research recommended against either option and using the Async approach instead. It was considered less problematic, less complicated and well suited this scenario. I'm hoping to keep the solution simpler as it doesn't warrant complexity -- it's a nicety for the user, but this isn't a commercial application.

  4. #4
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: Need Simple Async/Await Progress Bar Example

    Hello,

    Look at the first link in my signature for an example that uses Async/await includes a progress bar. All the work is done in a class project called from a Forms project.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2014
    Posts
    12

    Re: Need Simple Async/Await Progress Bar Example

    Hi Kevininstructor,

    Thank you for responding to my problem. The example referred to that came the closest, that I found using a progress label, was Asynchronous demos for read/write files using Async and Await for VS2012 or high. This example was in the Asynchronous demos for read/write files.... Just wanted to confirm that was what you meant so I don't off on a wild goose chase.

  6. #6
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: Need Simple Async/Await Progress Bar Example

    Both projects would be good to learn from and for the record both were done as there are not many decent examples other than the web downloads as you have found out.

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2014
    Posts
    12

    Re: Need Simple Async/Await Progress Bar Example

    Great! Thanks for the help, I'll dive in to them.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width