By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Q: Updating a smooth progress control

P: n/a
Hi

I have been using a smooth progress control using the following link:

http://support.microsoft.com/default...en-us;323088#2

It works well, however I can't seem to get it to update properly.

For example, I created a test application which had the smooth progress form
and the "standard" progress control supplied with Visual Studio. I set up
the two controls to increment using the following code:

ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 11
ProgressBar1.Value = 0
MySmoothProgressBar1.Minimum = 0
MySmoothProgressBar1.Maximum = 11
MySmoothProgressBar1.Value = 0

For i As Integer = 0 To 10
For j As Integer = 0 To 100000000
'Do Nothing
Next
MySmoothProgressBar1.Value += 1
ProgressBar1.Value += 1
Next

The standard progress control increments as expected. However, the smooth
progress control only updates at the end i.e. when the standard progress
control has reached its maximum.

Can anybody help with this?

Thanks in advance

Geoff

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Geoff Jones" <no********@email.com> schrieb:
For i As Integer = 0 To 10
For j As Integer = 0 To 100000000
'Do Nothing
Next
MySmoothProgressBar1.Value += 1
ProgressBar1.Value += 1
Untested:

\\\
Me.ProgressBar1.Refresh()
///
Next

The standard progress control increments as expected. However, the smooth
progress control only updates at the end i.e. when the standard progress
control has reached its maximum.


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

P: n/a
Hi Herfried

Genius!!!

Thanks. That did the trick.

As a matter of interest, and in the hope that the best way to learn is to
experiment, what methods could I use to implement the same thing within the
Microsoft progress control and why doesn't the current code work? That is,
by looking at their code, I see in the "Value" function:

Me.Invalidate(updateRect)

so the code has been written to update the progress control after a value
re-assignment e.g.

SmoothProgressBar1.Value += 1

would call the "Invalidate" (which I assume is used for re-painting?).
However, it doesn't do it! Indeed, when I tried to debug the code I fount
that OnPaint was not called after this "Invalidate" (I expected it would).

Has anyone any thoughts?

Geoff

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Ov**************@TK2MSFTNGP11.phx.gbl...
"Geoff Jones" <no********@email.com> schrieb:
For i As Integer = 0 To 10
For j As Integer = 0 To 100000000
'Do Nothing
Next
MySmoothProgressBar1.Value += 1
ProgressBar1.Value += 1


Untested:

\\\
Me.ProgressBar1.Refresh()
///
Next

The standard progress control increments as expected. However, the smooth
progress control only updates at the end i.e. when the standard progress
control has reached its maximum.


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.