Search:
Namespaces
Discussions
.NET v1.1
Feedback
ProgressBar stops when lost focus
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.framework.windowsforms
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
M K
I have a dialog box that takes a folder path and then creates thumbnails. It
works well. However, my progress bar (I'm using the default .Net ProgBar)
stops if the form loses focus. The code is still running in the background,
but I no longer know how far along it's gone.
My code is something like this:
For Each curFile in arrFiles
'...Add to dataset
'...Create thumbnail
x+=1
Me.pbImages.PerformStep() 'Have the progress bar perform a step
Me.label1.Text = Me.pbImages.Value & " of " & Me.pbImages.Maximum
Me.Refresh()
Next
I've tried some of the threaded examples, but I can't seem to get them
right. It seems like it should be a simple thing. What am I missing.
Reply to this message...
Imran Koradia (VIP)
Add the line
Application
.DoEvents in your loop; this gives the UI a chance
to repaint itself if it needs to - like when the form loses focus and then
regains the focus.
> For Each curFile in arrFiles
Application
.DoEvents
[Original message clipped]
hope that helps..
Imran.
Reply to this message...
M K
Thank you soo much! That was it.
"Imran Koradia" wrote:
[Original message clipped]
Reply to this message...
System.Windows.Forms.Application
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com