The standard answer here is, "Put the method call into a thread." On Windows, the progressbar (as well as the rest of the UI) relies on being serviced by the "event loop", which runs in the main thread. Any other code running in the main thread causes the event loop to be delayed until that code finishes. So you see no UI updates during that time. Putting the code into a thread allows the event loop to share time with that code.

What appears to be happening is that the progressbar displays and runs with a sort of oscillating display. It definitely is not updating and I can tell that the timer.action is not running. I have the timer period set to 1000 and almost 5000 records that are being processed. Even if I change the timer period to 10000, the display is not updating. From what I can tell, the timer.action is only being run when the ScanAssets() method ends.

Does it matter if the code in the ScanAssets() updates some controls (text boxes) on the window? I was reading that the code in the thread can not update any controls and since I do update some controls is that what's causing the progressbar to not update properly?

You shouldn't update controls from the thread. But that won't block the progressbar. More likely your thread isn't yielding enough time to the UI. This can take a little trial and error to get the right balance of throughput and smooth display updating.

Either reduce the priority of the thread, or put in an occasional app.YieldNextThread call. If you go with yielding, do it every X milliseconds, not every time through the loop. Updating the display a few times per second is enough to produce a pleasing progress indicator.

Thanks for your help. As usual you provide the solution I was looking for. By putting the app.yieldtonextthread in my loop, I now have a progressbar that is updating properly. I will need to tweak it a bit because I don't want to slow things down too much, which is what is happening now. I'm going to put in some code to only do this every few hundred records.

One other complication is that my app allows the user to create an unlimited number of data files - it's an accounting application and they will be creating files for their clients. The files may be on a local drive or a network drive and if it's on a network, I probably don't want to slow it down too much because the network will do that for me.

Nevertheless, you've got me going in the right direction and I greatly appreciate it.

One other thing I just might mention. I originally had my progress bar on a sheet window in OSX and just assumed that it would show up as a modal window in Windows. However, that wasn't the case ... it didn't show up at all. Do you think it's due to the same reason that the thread was not allowing the UI to update?