johnstoned
asked on
Coloured rows in check list box
I have a check list box component that displays a list of tasks to be completed.
I would like to be able to change the colour of a line if it has been active for more than 4 hours, but can't find a way to change 1 row's font attributes without changing every row.
Any ideas?
I would like to be able to change the colour of a line if it has been active for more than 4 hours, but can't find a way to change 1 row's font attributes without changing every row.
Any ideas?
Use the ondrawitem event to change the font color for a particular line
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This bit of code seemed to have a bug. It keeps flashing the items up in the screen then redrawing them again.
if (Control as TCheckListBox).Checked[Ind ex] then
(Control as TCheckListBox).font.Color: = clRed
else
(Control as TCheckListBox).font.Color: = clBlack;
After a little experimentation, I changed
Control as TCheckListBox).font.Color: = clRed
to
font.Color:= clRed
and that seemed to cure it.
Thanks for the help.
if (Control as TCheckListBox).Checked[Ind
(Control as TCheckListBox).font.Color:
else
(Control as TCheckListBox).font.Color:
After a little experimentation, I changed
Control as TCheckListBox).font.Color:
to
font.Color:= clRed
and that seemed to cure it.
Thanks for the help.
ASKER
This bit of code seemed to have a bug. It keeps flashing the items up in the screen then redrawing them again.
if (Control as TCheckListBox).Checked[Ind ex] then
(Control as TCheckListBox).font.Color: = clRed
else
(Control as TCheckListBox).font.Color: = clBlack;
After a little experimentation, I changed
Control as TCheckListBox).font.Color: = clRed
to
font.Color:= clRed
and that seemed to cure it.
Thanks for the help.
if (Control as TCheckListBox).Checked[Ind
(Control as TCheckListBox).font.Color:
else
(Control as TCheckListBox).font.Color:
After a little experimentation, I changed
Control as TCheckListBox).font.Color:
to
font.Color:= clRed
and that seemed to cure it.
Thanks for the help.