Progressbar en couleur , degrade !!!!!!!

Description

Ce programme vous permet de faires des progressebar dégradé , Affichant le pourcentage très lisiblement , avec un arrière-plan Dégradé, N'oubliez pas les déclarations des api lineto et Movetoex car il sont obligatoire pour une rapidité remarquable.

Ma source téléchargeable est plus bien faite, mais cette source est particulièrement pour Moustachu :

Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Public cg As Integer
Public Sub pgrco(pgr As Object, ByVal pgrv As Integer, r1 As Integer, v1 As Integer, b1 As Integer, r2 As Integer, v2 As Integer, b2 As Integer)
Dim li As POINTAPI
ss = pgr.AutoRedraw
dd = pgr.ScaleMode
pgr.ScaleMode = 3
pgr.AutoRedraw = 1
h1 = Abs(r1 + Int(((pgr.ScaleWidth / 100) * (100 - pgrv) * ((r2 - r1) / pgr.ScaleWidth))))
h2 = Abs(v1 + Int(((pgr.ScaleWidth / 100) * (100 - pgrv) * ((v2 - v1) / pgr.ScaleWidth))))
h3 = Abs(b1 + Int(((pgr.ScaleWidth / 100) * (100 - pgrv) * ((b2 - b1) / pgr.ScaleWidth))))
pgr.BackColor = RGB(h1, h2, h3)

For i = 0 To (pgr.ScaleWidth / 100) * pgrv

h1 = Abs(r1 + Int(((pgr.ScaleWidth / 100) * pgrv * ((r2 - r1) / pgr.ScaleWidth))))
h2 = Abs(v1 + Int(((pgr.ScaleWidth / 100) * pgrv * ((v2 - v1) / pgr.ScaleWidth))))
h3 = Abs(b1 + Int(((pgr.ScaleWidth / 100) * pgrv * ((b2 - b1) / pgr.ScaleWidth))))
li.x = i
li.y = 0
pgr.ForeColor = RGB(h1, h2, h3)
MoveToEx pgr.hdc, i, 0, li
LineTo pgr.hdc, i, pgr.ScaleHeight
Next
li.x = pgr.ScaleWidth / 100 * pgrv
li.y = 0
h1 = Abs(r1 - (2 * ((r1 - r2))) - 128)
h2 = Abs(v1 - (2 * ((v1 - v2))) - 128)
h3 = Abs(b1 - (2 * ((b1 - b2))) - 128)
pgr.ForeColor = RGB(h1, h2, h3)
MoveToEx pgr.hdc, pgr.ScaleWidth / 100 * pgrv, 0, li
LineTo pgr.hdc, pgr.ScaleWidth / 100 * pgrv, pgr.ScaleHeight
pgr.CurrentX = pgr.ScaleWidth / 2 - 10
pgr.CurrentY = pgr.ScaleHeight / 2 - 5
pgr.FontBold = True
pgr.Print pgrv & "%"
pgr.Refresh
pgr.AutoRedraw = ss
pgr.ScaleMode = dd
End Sub

Private Sub Form_Load()
Timer1.Interval = 20
End Sub

Private Sub Timer1_Timer()
cg = (cg + 1) Mod 101
pgrco pgrr, Val(cg), 255, 0, 0, 0, 255, 0
End Sub

Conclusion :


Voir mon site:plusieurs source , tutoriaux , cours
http://membres.lycos.fr/fildomen/

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.