OwnerDraw on ListBox lazarus / 31-LCL ---------------------------------------------------------------------- bigeno · 2013-11-08 16:57 Hi, I've little problem with DrawItem on ListBox. I want to get similar drawing as original Style (lbStandard). This is my code: Code: [Select]procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState); begin   with (Control as TListBox).Canvas do begin     Brush.Style := bsSolid;     if not ListBox1.Selected[Index] then begin        Brush.Color := clWhite     end else begin        Font.Color := clWhite;     end;     FillRect(aRect);     Brush.Style := bsClear;     TextOut(aRect.Left, aRect.Top, (Control as TListBox).Items[Index]);   end; end; but font height and focus rect is different, on attached image. How to get proper font height and remove rectangle border when item focused ? ---------------------------------------------------------------------- bigeno · 2013-11-08 17:26 ok, I found focus rect Code: [Select]    FillRect(aRect);     Pen.Style:=psClear;     Brush.Style := bsClear;     TextOut(aRect.Left + 2, aRect.Top, (Control as TListBox).Items[Index]);     if (odFocused in State) then        DrawFocusRect(aRect);  so items height left.