hitman00
Messages postés23Date d'inscriptionlundi 28 juillet 2003StatutMembreDernière intervention 5 décembre 2005
-
28 févr. 2005 à 17:32
hitman00
Messages postés23Date d'inscriptionlundi 28 juillet 2003StatutMembreDernière intervention 5 décembre 2005
-
1 mars 2005 à 11:46
Dans une listview je recupere des infos de ma base de données mais j'aimerais changer de couleur a chaque fois qu'un champ (Le champ ETAGE) change d'etat .
Comment faire.
Merci d'avance pour vos reponse
jpleroisse
Messages postés1788Date d'inscriptionmardi 7 novembre 2000StatutMembreDernière intervention11 mars 200627 28 févr. 2005 à 20:58
Ce code, qui n'est pas de moi , je l'ai modifié pour une Listview.
En le modifiant encore un peu du doit pouvoir l'utliser comme tu le veux.
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Text1_Change()
Dim a, b, c, d, e, f
Dim Red As Integer
Dim Green As Integer
Dim Blue As Integer
Red = 255
Green = 0
Blue = 0
If Red 255 And Green 0 And Blue = 0 Then
For a = 0 To 255
Green = a
Sleep 8
DoEvents
ListView1.BackColor = RGB(Red, Green, Blue)
Next a
End If
If Red 255 And Green 255 And Blue = 0 Then
For b = 255 To 0 Step -1
Red = b
Sleep 8
DoEvents
ListView1.BackColor = RGB(Red, Green, Blue)
Next b
End If
If Red 0 And Green 255 And Blue = 0 Then
For c = 0 To 255
Blue = c
Sleep 8
DoEvents
ListView1.BackColor = RGB(Red, Green, Blue)
Next c
End If
If Red 0 And Green 255 And Blue = 255 Then
For d = 255 To 0 Step -1
Green = d
Sleep 8
DoEvents
ListView1.BackColor = RGB(Red, Green, Blue)
Next d
End If
If Red 0 And Green 0 And Blue = 255 Then
For e = 0 To 255
Red = e
Sleep 8
DoEvents
ListView1.BackColor = RGB(Red, Green, Blue)
Next e
End If
If Red 255 And Green 0 And Blue = 255 Then
For f = 255 To 0 Step -1
Blue = f
Sleep 8
DoEvents
ListView1.BackColor = RGB(Red, Green, Blue)
Next f
End If