Und hier noch einmal das ganze im OnDrawSubItem
Delphi-Quellcode:
procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: integer; State: TCustomDrawState; var DefaultDraw: boolean);
var
rect: TRect;
Text: string;
begin
DefaultDraw := False;
if (SubItem = 1) and (CheckBox1.Checked) then
begin
Text := StringOfChar('*',Length(Item.SubItems[0]))
end
else
begin
Text := Item.SubItems[SubItem - 1]
end;
ListView_GetSubItemRect(Sender.Handle, Item.Index, SubItem, LVIR_BOUNDS, @rect);
(Sender as TListView).Canvas.TextRect(rect, Text);
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"