keithcsl
asked on
TListView Color...
Hi all
i have a list view with 2 columns, "Color" and "Name"...
I want to put one color for each row in the Color column. For a start, I have tried adding this in the onOwnerDraw:
ListView.Canvas.Brush.Colo r := clGreen;
ListView.Canvas.FillRect (Rect(0,0,2,2));
I thought this will fill a little box at the top left hand corner, but it
filled up the entire row. How do I solve this?
Keith
i have a list view with 2 columns, "Color" and "Name"...
I want to put one color for each row in the Color column. For a start, I have tried adding this in the onOwnerDraw:
ListView.Canvas.Brush.Colo
ListView.Canvas.FillRect (Rect(0,0,2,2));
I thought this will fill a little box at the top left hand corner, but it
filled up the entire row. How do I solve this?
Keith
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hei guys
i found the problem. first, i did not change the color back. but then, found that after coloring the canvas, the add item routine recolors it back to white.
it's getting too complicated. i have decided to abandon this method.
however, kambiz gave the right solution, so i am accepting that.
PS: i am posting another similar question.
Keith
i found the problem. first, i did not change the color back. but then, found that after coloring the canvas, the add item routine recolors it back to white.
it's getting too complicated. i have decided to abandon this method.
however, kambiz gave the right solution, so i am accepting that.
PS: i am posting another similar question.
Keith
Try a testproject with just a listview and your code, because it's correct.
F-).