- Public Sub GraphProgressBar(image As PictureBox, Pourcentage As Integer, Horizontal As Boolean, Optional AfficherTexte As Boolean = True, Optional CouleurFond As Long = vbRed, Optional TailleTexte As Integer = 8, Optional CouleurTexte As Long = vbBlack)
- Dim SPourcentage As String
- If Pourcentage < 0 Or Pourcentage > 100 Then Exit Sub
- SPourcentage = Pourcentage & "%"
- ScaleMode = 3
- image.Line (0, 0)-(image.ScaleWidth, image.ScaleHeight), image.BackColor, BF
- If Horizontal = True Then image.Line (0, 0)-((image.ScaleWidth / 100) * Pourcentage, image.ScaleHeight), CouleurFond, BF Else image.Line (0, image.ScaleHeight)-(image.ScaleWidth, image.ScaleHeight - (Pourcentage * (image.ScaleHeight / 100))), CouleurFond, BF
- image.CurrentX = (image.ScaleWidth - image.TextWidth(SPourcentage)) / 2
- image.CurrentY = (image.ScaleHeight - image.TextHeight(SPourcentage)) / 2
- image.FontSize = TailleTexte
- image.FontBold = True
- image.ForeColor = CouleurTexte
- image.Print IIf(AfficherTexte = True, SPourcentage, "")
- End Sub
-
-
Public Sub GraphProgressBar(image As PictureBox, Pourcentage As Integer, Horizontal As Boolean, Optional AfficherTexte As Boolean = True, Optional CouleurFond As Long = vbRed, Optional TailleTexte As Integer = 8, Optional CouleurTexte As Long = vbBlack)
Dim SPourcentage As String
If Pourcentage < 0 Or Pourcentage > 100 Then Exit Sub
SPourcentage = Pourcentage & "%"
ScaleMode = 3
image.Line (0, 0)-(image.ScaleWidth, image.ScaleHeight), image.BackColor, BF
If Horizontal = True Then image.Line (0, 0)-((image.ScaleWidth / 100) * Pourcentage, image.ScaleHeight), CouleurFond, BF Else image.Line (0, image.ScaleHeight)-(image.ScaleWidth, image.ScaleHeight - (Pourcentage * (image.ScaleHeight / 100))), CouleurFond, BF
image.CurrentX = (image.ScaleWidth - image.TextWidth(SPourcentage)) / 2
image.CurrentY = (image.ScaleHeight - image.TextHeight(SPourcentage)) / 2
image.FontSize = TailleTexte
image.FontBold = True
image.ForeColor = CouleurTexte
image.Print IIf(AfficherTexte = True, SPourcentage, "")
End Sub