Tabbed List Box Colors

I have a program that I use Tabbed List Boxes in.
What I would like to do is to get different items in one box to have multiple colors / fonts.

How can I get this to work?

Who is Participating?
intheConnect With a Mentor Commented:
i dont know ,im guessing this is like normal listbox so just set style to ownerdraw and add some code:

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
 i : integer;
  if Odd(Index) then
     i := clRed
     i := clYellow;
  TListBox(Control).Canvas.Brush.Color := i;
  if NOT Odd(Index) then
     i := clRed
     i := clYellow;
  TListBox(Control).Canvas.Font.Color := i;
  TListBox(Control).Canvas.TextRect(Rect, Rect.Left, Rect.Top,

basically if the component has ownderdraw style then you have access to all canvas and fonts brushes/pens colors styles etc..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.