BackColor - Help

Résolu
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008 - 24 mai 2006 à 16:41
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008 - 28 mai 2006 à 10:28
Bonjour,

J'ai créer un 'UserControl' contenant 3 'CommandButton'. J'ai utilisé le Wizard ActiveX de VB pour créer des propriétés BackColor pour le 'UserControl' et pour les 3 'CommandButton'. Jusque là, pas de problèmes. Mais quand je veux modifier la couleur des 3 'CommandButton' en mode création, je n'y arrive pas. Les valeurs des couleurs sont bien changées dans la fenêtre des propriétés, mais les 'CommandButton' ne change pas de couleur. Hors pour l'objet 'UserControl' ça fonctionne.

Est-ce que quelqu'un pourrais m'aider svp ?

Je ne vois pas comment faire pour résoudre ce problème.

D'avance, je vous remercie,

Ice.

10 réponses

cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
25 mai 2006 à 14:17
Et tes boutons, ils ont leur propriété style à graphical ?

_
Avant de poster dans le forum,
prière d'aller lire ceci :
http://www.codes-sources.com/reglement.aspx
<s></s>
3
erefdatacomputing Messages postés 165 Date d'inscription mardi 7 mars 2006 Statut Membre Dernière intervention 24 avril 2018
24 mai 2006 à 16:48
Voilà !!! à plus !!! 

Je comprend vite mais il faut m'expliquer longtemps et tout en détails !!!
0
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
24 mai 2006 à 17:15
Bah mets nous au moins le bout de code de ton usercontrol qui te permet de charger le backcolor des boutons, car sinon on pourrait pas faire grand chose pour toi !

_
Avant de poster dans le forum,
prière d'aller lire ceci :
http://www.codes-sources.com/reglement.aspx
<s></s>
0
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008
25 mai 2006 à 12:22
Ben, c'est le code généré par le wizard de VB.

Voilà :

'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=cmdLeft,cmdLeft,-1,BackColor
Public Property Get BackColorLeftButton() As OLE_COLOR
    BackColorLeftButton = cmdLeft.BackColor
End Property



Public Property Let BackColorLeftButton(ByVal New_BackColorLeftButton As OLE_COLOR)
    cmdLeft.BackColor = New_BackColorLeftButton
    PropertyChanged "BackColorLeftButton"
End Property



'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=cmdCenter,cmdCenter,-1,BackColor
Public Property Get BackColorCenterButton() As OLE_COLOR
    BackColorCenterButton = cmdCenter.BackColor
End Property



Public Property Let BackColorCenterButton(ByVal New_BackColorCenterButton As OLE_COLOR)
    cmdCenter.BackColor = New_BackColorCenterButton
    PropertyChanged "BackColorCenterButton"
End Property



'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=cmdRight,cmdRight,-1,BackColor
Public Property Get BackColorRightButton() As OLE_COLOR
    BackColorRightButton = cmdRight.BackColor
End Property



Public Property Let BackColorRightButton(ByVal New_BackColorRightButton As OLE_COLOR)
    cmdRight.BackColor = New_BackColorRightButton
    PropertyChanged "BackColorRightButton"
End Property

'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)



    Call PropBag.WriteProperty("ForeColor", UserControl.ForeColor, &H80000012)
    Call PropBag.WriteProperty("Enabled", m_Enabled, m_def_Enabled)
    Call PropBag.WriteProperty("Font", UserControl.Font, Ambient.Font)
    Call PropBag.WriteProperty("BackStyle", UserControl.BackStyle, 1)
    Call PropBag.WriteProperty("BorderStyle", UserControl.BorderStyle, 0)
    Call PropBag.WriteProperty("BackColorFrame", UserControl.BackColor, &H8000000F)
    Call PropBag.WriteProperty("BackColorLeftButton", cmdLeft.BackColor, &H8000000F)
    Call PropBag.WriteProperty("BackColorCenterButton", cmdCenter.BackColor, &H8000000F)
    Call PropBag.WriteProperty("BackColorRightButton", cmdRight.BackColor, &H8000000F)
   
End Sub

'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)



    UserControl.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
    m_Enabled = PropBag.ReadProperty("Enabled", m_def_Enabled)
    Set UserControl.Font = PropBag.ReadProperty("Font", Ambient.Font)
    UserControl.BackStyle = PropBag.ReadProperty("BackStyle", 1)
    UserControl.BorderStyle = PropBag.ReadProperty("BorderStyle", 0)
    UserControl.BackColor = PropBag.ReadProperty("BackColorFrame", &H8000000F)
    cmdLeft.BackColor = PropBag.ReadProperty("BackColorLeftButton", &H8000000F)
    cmdCenter.BackColor = PropBag.ReadProperty("BackColorCenterButton", &H8000000F)
    cmdRight.BackColor = PropBag.ReadProperty("BackColorRightButton", &H8000000F)
   
End Sub
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008
26 mai 2006 à 15:59
Dark Sidious,

Non, effectivement les 'CommandButton' avaient la propriété 'Style' à 'Standard'. En changeant cette prorpiété par 'Graphical', le changement de la propriété 'BackColor' a fonctionné. Je ne savais pas qu'il fallait changer cette propriété pour que ça marche. Je suppose que c'est le même pour toutes les propriétés graphique des 'CommandButton'.

Je te remercie encore pour cette réponse.



@,




 



Ice.
0
erefdatacomputing Messages postés 165 Date d'inscription mardi 7 mars 2006 Statut Membre Dernière intervention 24 avril 2018
27 mai 2006 à 09:28
Salut !!!
As- tu regardé l'impression d'écran que tu as reçu en 1 ère réponse ?
Avec la petite flèche indiquant que la propriété 'Style' du CommandButton devait être sur '1-Graphical'  !!!
Je croyais que c'était assez explicite !!!
Je pense que tu aurais gagné du temp  !!!
à plus !!!
0
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
27 mai 2006 à 10:04
Les captures d'écrans ne passent pas sur le site si elles sont stockées en local !

_
Avant de poster dans le forum,
prière d'aller lire ceci :
http://www.codes-sources.com/reglement.aspx
<s></s>
0
erefdatacomputing Messages postés 165 Date d'inscription mardi 7 mars 2006 Statut Membre Dernière intervention 24 avril 2018
27 mai 2006 à 14:18
Oups !!!  Alors j'ai envoyé un message 'Vide' ?

Comment fait-on pour envoyer des images ?  SVP ? 

Je comprends vite mais il faut m'expliquer longtemps et tout en détails !!!
0
cs_DARKSIDIOUS Messages postés 15814 Date d'inscription jeudi 8 août 2002 Statut Membre Dernière intervention 4 mars 2013 130
27 mai 2006 à 14:55
Bah il faut les uploader sur un ftp et mettre le lien.

_
Avant de poster dans le forum,
prière d'aller lire ceci :
http://www.codes-sources.com/reglement.aspx
<s></s>
0
cs_IcebergMan Messages postés 41 Date d'inscription vendredi 11 février 2005 Statut Membre Dernière intervention 11 décembre 2008
28 mai 2006 à 10:28
Désolé erefdatacomputing mais je n'ai pas vu ton image. Merci quand même pour ton aide.



@+



Ice.
0
Rejoignez-nous