LucieLastic
Programmer
hi
How can I set certain items in a list box to a different colour? I tried the following but didn't work
procedure TFormCoList.ListBoxCompaniesDrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
if index = 5 then
(Control as TListBox).Canvas.font.Color := clred
else (Control as TListBox).Canvas.font.Color := clblack;
end;
many thanks
lou
How can I set certain items in a list box to a different colour? I tried the following but didn't work
procedure TFormCoList.ListBoxCompaniesDrawItem(Control: TWinControl;
Index: Integer; Rect: TRect; State: TOwnerDrawState);
begin
if index = 5 then
(Control as TListBox).Canvas.font.Color := clred
else (Control as TListBox).Canvas.font.Color := clblack;
end;
many thanks
lou