I subclassing the textbox so I can create my GUI with classes.
Im having problem with DrawText,
I get the text of the button and redraw the text once ive filled in the button with color.
But when I redraw, the text is bold.
How do I draw the text to be the same as it originally was before I colored in the button?? i.e. same font and size and wieght.

thanks


Here some code.


void SetBkGrColor(HWND dhwnd,long color,int updown)
{
HBRUSH tBrush;
HFONT tFont;
RECT tRec;
RECT tRec2;
HDC tHdc;
string ss;
//Get the caption of the button
GetCaption(ss);
//get the button DC
tHdc=GetDC(dhwnd);
//set the fill color
tBrush=CreateSolidBrush(color);
//get the DC rect
GetClientRect(dhwnd,&tRec);
tRec2=tRec;
//change the Rectangle for filling the button
tRec2.bottom=tRec2.bottom -2;
tRec2.top =tRec2.top +1;
tRec2.left=tRec2.left+1;
tRec2.right=tRec2.right-2;
//fill the button in with some color
FillRect(tHdc,&tRec2,tBrush);
//set color of the text
SetTextColor(tHdc,0);
SetBkMode(tHdc , TRANSPARENT);
tRec.top=tRec.top +updown;
if (ss.length()>0)
{
//redraw the text only if there was text there.
//else we crash
DrawText(tHdc, &ss.at(0) ,1,&tRec,DT_EDITCONTROL);
}
//DC no longer needed, so release it.
ReleaseDC(dhwnd,tHdc);
}