Where you are forcing a refresh, you could try calling the control's Refresh() instead or alternatively Invalidate() followed by Update().
>Since I moved to Windows 7, the progress bar control is offset when displaying the percentage. Basically, I am doing a DoEvents() at the end to refresh the display. It goes like this:
>
>
> ' Show the progress
> ' expN1 Value
> ' expC1 Text
> ' Optional
> Public Function ShowProgress(ByVal tnValue As Integer, _
> Optional ByVal tcText As String = "") As Boolean
>
> ' If the form is not visible
> If Not Visible Then
> Show()
> End If
>
> ' If we have a text
> If tcText.Length > 0 Then
> oLabel.Text = tcText
> End If
>
> ' If the value is lower or equal to 100
> If tnValue <= 100 Then
> oProgressBar.Value = tnValue
> End If
>
> ' Percentage
> oLabelPercentage.Text = tnValue.ToString + "%"
>
> ' Force a refresh
> Windows.Forms.Application.DoEvents()
>
> Return True
> End Function
>
>
>However, depending on the process, the percentage display will be offset by 1 to 20%. Basically, showing 100% will be as if it would be at 85%. Then, 15% will be as if it would be 0%. And, so will be the case for various variations depending on the process.
>
>The only way I have succeeded to make it work as it was under XP Pro is to force a Messagebox.Show() after each call to this method. For some kind of reason, this makes the desktop to react and all is ok. Of course, I cannot run with Message.Show() turned ON. So, if anyone would have an idea for a workaround, I would be happy to try it.
Mathias Banda
Time is longer than a rope.