Board index » cppbuilder » How to "actually draw the entire item yourself manually."?
Jackie
![]() CBuilder Developer |
Jackie
![]() CBuilder Developer |
How to "actually draw the entire item yourself manually."?2004-09-10 10:55:21 AM cppbuilder80 QuoteAs far as I know, the only way to change the highlight color is to set Would you like to show me the codes? |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2004-09-10 01:22:06 PM
Re:How to "actually draw the entire item yourself manually."?
"Jackie" < XXXX@XXXXX.COM >wrote in message
QuoteHow to "actually draw the entire item yourself manually."? the TextRect() method to draw the item's text on top of the background. The State parameter of the event handler tells you whether the item being drawn should be drawn highlighted, focused, etc. QuoteI didn't find those codes in <BC>/Source/vcl/comctrls.pas. Gambit |
Jackie
![]() CBuilder Developer |
2004-09-11 09:58:12 AM
Re:How to "actually draw the entire item yourself manually."?
Thank you very much, though I don't think I understand about the "The OS
itself is". These codes can change highlight color to yellow. But not subitems, how can I know the subitem's Caption and their Position? void __fastcall TFormMain::_listCustomDrawItem(TCustomListView *Sender, TListItem *Item, TCustomDrawState State, bool &DefaultDraw) { if( State.Contains(cdsSelected) ) { TRect rect_head, rect = Item->DisplayRect(drLabel); GetWindowRect(FindWindowEx(_list->Handle, 0, "SysHeader32", NULL), &rect_head); rect.Right = rect_head.Right; _list->Canvas->Brush->Color = clYellow; _list->Canvas->FillRect(rect); _list->Canvas->TextOut(rect.Left + 2, rect.Top, Item->Caption); DefaultDraw = false; } } {smallsort} |