468,316 Members | 2,150 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

Q: Updating a smooth progress control

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
2 1449
"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
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.

Similar topics

3 posts views Thread by Daniel Pryde | last post: by
5 posts views Thread by Claire | last post: by
reply views Thread by Marc Miller | last post: by
8 posts views Thread by Brian Henry | last post: by
6 posts views Thread by =?Utf-8?B?S2Fp?= | last post: by
4 posts views Thread by directory | last post: by
1 post views Thread by K Viltersten | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.