Change color of controls of a dialog
-
I can change the background colors of child controls of a dialog by responding to the WM_CTLCOLORxxx messages Example: case WM_CTLCOLORBTN: hBrushButton = CreateSolidBrush(RGB(255,102,15)); return (int)hBrushButton; Now I'm looking for a way to change the textcolor as well. This for buttons, labels, listboxes, ... Thanks in advance, Ward http://users.belgacom.net/wardvantichelen
-
I can change the background colors of child controls of a dialog by responding to the WM_CTLCOLORxxx messages Example: case WM_CTLCOLORBTN: hBrushButton = CreateSolidBrush(RGB(255,102,15)); return (int)hBrushButton; Now I'm looking for a way to change the textcolor as well. This for buttons, labels, listboxes, ... Thanks in advance, Ward http://users.belgacom.net/wardvantichelen
Check these api's [SetTextColor],[SetBkColor]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Check these api's [SetTextColor],[SetBkColor]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
That helped me. Thanks! My code is now the following: case WM_CTLCOLORSTATIC: hBrushButton = CreateSolidBrush(RGB(255,102,15)); SetTextColor((HDC) wParam, RGB(255,255,255)); SetBkColor((HDC) wParam, RGB(255,102,15)); return (int)hBrushButton; This results is a nice orange label with white text.:) Greetz, Ward See more from me at http://users.belgacom.net/wardvantichelen
-
That helped me. Thanks! My code is now the following: case WM_CTLCOLORSTATIC: hBrushButton = CreateSolidBrush(RGB(255,102,15)); SetTextColor((HDC) wParam, RGB(255,255,255)); SetBkColor((HDC) wParam, RGB(255,102,15)); return (int)hBrushButton; This results is a nice orange label with white text.:) Greetz, Ward See more from me at http://users.belgacom.net/wardvantichelen
Ward wrote: This results is a nice orange label with white text. :doh: Are you trying to make a copy of code project :-) ?
-
Ward wrote: This results is a nice orange label with white text. :doh: Are you trying to make a copy of code project :-) ?
Hihihi! I've never thought that I was using the same colors. Nice reply though! Ward:laugh: http://users.belgacom.net/wardvantichelen
-
That helped me. Thanks! My code is now the following: case WM_CTLCOLORSTATIC: hBrushButton = CreateSolidBrush(RGB(255,102,15)); SetTextColor((HDC) wParam, RGB(255,255,255)); SetBkColor((HDC) wParam, RGB(255,102,15)); return (int)hBrushButton; This results is a nice orange label with white text.:) Greetz, Ward See more from me at http://users.belgacom.net/wardvantichelen
Ward wrote: Thanks! Mention Not!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta