ktang
January 7th, 2003, 03:51 PM
I am not using MFC, but I want to set color for the text of pushbottons or set color for the whole button. Could anyone give me some ideas about how to do that? Thanks in advance!
|
Click to See Complete Forum and Search --> : set color for the text of a pushbutton ktang January 7th, 2003, 03:51 PM I am not using MFC, but I want to set color for the text of pushbottons or set color for the whole button. Could anyone give me some ideas about how to do that? Thanks in advance! sgenie January 7th, 2003, 05:18 PM Use WM_CTLCOLORBTN filthy_mcnasty January 8th, 2003, 10:34 PM WM_CTLCOLORBTN is a message that doesn't work like you would imagine it should. i have never ever gotten it to work in the same manner as WM_CTLCOLORLISTBOX or whatnot and because of that i'm fairly sure that you have to set your button to owner drawn and set the text and the color dynamically. actually i'll play around with that notion so i'll repost if i find that it doesn't work. filthy_mcnasty January 8th, 2003, 10:48 PM you have to set it to owner drawn and then the bg color will change but not the text and that was the initial question. the button still functions too but the text isn't there. how to set the text of an owner drawn button would be the next question probably and i have no idea how. you could put a static text over the top *i did that a long time ago myself to "solve" this problem* or you could just handle the wm_lbutton messages over a specific spot and simulate a button but i dunno, just throwing out ideas. dexter_ksk March 3rd, 2006, 08:21 AM Do you know how to set the text using WM_CTLCOLORBTN Mike Harnad March 3rd, 2006, 09:20 AM Eventhough you are not using MFC, take a look at the MSDN description for CWnd::OnCtlColor. Using the example code, you should be able to convert it to its equivalent Win32 code. codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved. |