Set the Style property to lbOwnerDrawFixed and :
procedure TForm1.ListBox1DrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
with ListBox1 do
begin
Canvas.FillRect( Rect );
if Index in [0..1] then // for example.
First two items are drawn
bold
Canvas.Font.Style := [fsBold];
DrawText( Canvas.Handle, @Items[Index][1], Length(
Items[Index] ),
Rect, 0 );
end;
end;
version 2
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if (control as Tlistbox).items[index] = 'two' then
(Control as TListBox).Canvas.Font.Style :=
[fsBold]
else
(Control as TListBox).Canvas.Font.Style :=
[];
(Control as TListBox).Canvas.TextOut(Rect.Left+2, Rect.Top+1,
(Control as
TListBox).Items[Index]); {display the text }
end;