XP_aie_aie
Messages postés13Date d'inscriptionmercredi 1 mars 2006StatutMembreDernière intervention28 septembre 2006
-
8 août 2006 à 16:12
XP_aie_aie
Messages postés13Date d'inscriptionmercredi 1 mars 2006StatutMembreDernière intervention28 septembre 2006
-
9 août 2006 à 08:59
Salut tout le monde,
J'esperais changer la couleur de tous mes label en tappant ca :
---------
Sub LockeLeFrame()
Dim Ctrl
'colorer en gris tous les label du frame
For Each Ctrl In UFGestionFormation.FrameFormation.Controls
If TypeOf Ctrl Is Label Then
Ctrl.ForeColor = &HC0C0C0
End If
Next Ctrl
UFGestionFormation.FrameFormation.Enabled = False
End Sub
--------
Mais ca marche pas ?? pas d'erreur juste que ca marche pas.
J'ai fait une betise ?
Dolphin Boy
Messages postés630Date d'inscriptionvendredi 5 mai 2006StatutMembreDernière intervention17 février 2007 8 août 2006 à 16:46
Salut, j'ai essay ton code et effectivement ça ne marche pas en VBA (en vb6 ça fonctionne parfaitement). Comme je ne suis pas fortiche en VBA Excel, je n'en connais pas la cause par contre, essaies ça, chez moi ça marche :
Sub LockeLeFrame()
Dim Ctrl
'colorer en gris tous les label du frame
For Each Ctrl In UFGestionFormation.FrameFormation.Controls
If TypeName(Ctrl) = "Label" Then
Ctrl.ForeColor = &HC0C0C0
End If
Next Ctrl
UFGestionFormation.FrameFormation.Enabled = False
End Sub