Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progress bar offset in Windows 7
Message
De
24/07/2010 15:06:11
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Progress bar offset in Windows 7
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01473714
Message ID:
01473714
Vues:
83
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.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform