Vitaliy Margolen wrote:

Thursday, April 14, 2005, 11:50:50 AM, you wrote:


Vitaliy Margolen wrote:


Ok, I need help here. I spend half a day trying to fix this. I moved send notify
after color and font setup in TREEVIEW_DrawItem. It's getting closer to native.
But! No matter what I try, I can't set background color from within Delphi App
on DrawItemNotify. Which does work on windows.

Am I missing something? I changed text mode to opaque, so it should use current
brush color for background. But when I printing GetDCBrushColor it stays the
same! Could we have a problem somewhere in GDI?


Thank you! One thing I can't understand is why I couldn't see those changes
directly in DC? Unless there are something more going on inside Delphi
components.
Any way, thanks for you help, patch in a queue.



{Set,Get}DCBrushColor do something different to what you expect. They set the DC_BRUSH colour, not the colour of the current brush selected into the DC. You can get select it into the DC using SelectObject(GetStockObject(DC_BRUSH)). The concept was probably introduced for this very use though, so you don't have to create a temporary solid brush and then delete it again.


Rob



Reply via email to