Otacon87
Messages postés8Date d'inscriptionlundi 29 mars 2004StatutMembreDernière intervention17 mai 2005
-
22 mars 2005 à 00:55
totolamure
Messages postés2Date d'inscriptionlundi 1 mars 2004StatutMembreDernière intervention26 août 2005
-
26 août 2005 à 11:20
Voilà j'ai un problème je voudrai modifier la couleur d'un bouton.
J' utilise la fonction WM_CTLCOLORBTN comme ceci:
case CTLCOLORBTN:
return CreateSolidBrush(RGB(255,255,0));
Mais rien ne se passe alors que si j'utilise CTLCOLORDLG celà marche.
racpp
Messages postés1909Date d'inscriptionvendredi 18 juin 2004StatutModérateurDernière intervention14 novembre 201417 22 mars 2005 à 02:28
Salut,
Le message WM_CTLCOLORBTN ne permet pas de changer la couleur des boutons normaux. C'est précisé dans MSDN : <<
Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles
do not use the returned brush. Buttons with these styles are always
drawn with the default system colors. Drawing push buttons requires
several different brushes-face, highlight and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom
appearance for push buttons, use an owner-drawn-button. >>.
Voici un code source montrant comment changer la couleur des boutons (entre autres) :