DrawItem事件中
TCanvas *pCanvas;
pCanvas = ((TListBox *)Control)->Canvas;
pCanvas->Brush->Color = clWhite;
pCanvas->Font->Color = clBlack;
pCanvas->FillRect(Rect);
pCanvas->Brush->Color = TColor(0x00FFF7F7);
pCanvas->Pen->Color = TColor(0x00131315);
pCanvas->Rectangle(Rect.left+2,Rect.Top+2,Rect.right-2,Rect.bottom-2);
if(State.Contains(odSelected))
{
ListBox1->Canvas->Brush->Color = TColor(0x00FFB2B5);
pCanvas->Rectangle(Rect.left+2,Rect.Top+2,Rect.right-2,Rect.bottom-2);
ListBox1->Canvas->Font->Color = clBlue;
}
if(State.Contains(odFocused))
::DrawFocusRect(pCanvas->Handle, &Rect);
pCanvas->Draw(Rect.left+4,Rect.top+(Rect.Height()-Image2->Height)/2,Image2->Picture->Graphic);
pCanvas->TextOutA(Rect.left+4+Image2->Width+4,Rect.top+6,((TListBox *)Control)->Items->Strings[Index]);