is it possible just to change the text color of a CStatic control? i made a class derived from CStatic and i want to change the text color on MouseMove event i dont wanna use the paint event because i will have to use my own text wrap function and i dont wanna use that, for now i got this code:
HBRUSH CLabel::CtlColor(CDC* pDC, UINT nCtlColor)
brush = (HBRUSH)::CreateSolidBrush(dc.GetPixel(24, 24));
You create the brush on the stack. Create a brush as member of the class.
can you give me an example please ? i dont really understand what you mean
Create a class member of type HBRUSH. You only need to create one brush object. Update via SetDCBrushColor().