Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progress bar offset in Windows 7
Message
 
To
24/07/2010 15:06:11
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01473714
Message ID:
01473717
Views:
33
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform