Aber ich:
Delphi-Quellcode:
procedure TDemoForm.ColorButtonClick(Sender: TObject);
var
tn: TTreeNode;
begin
tn := TreeView.Selected;
if not Assigned(tn) then
Exit;
tn.Data := Pointer(1 - Integer(tn.Data));
TreeView.Invalidate;
end;
procedure TDemoForm.TreeViewCustomDrawItem(Sender: TCustomTreeView;
Node: TTreeNode; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
if Assigned(Node.Data)
then Sender.Canvas.Font.Color := clRed
else Sender.Canvas.Font.Color := clBlack;
end;
Stelle HideSelection auf FALSE - besser ist das...
Grüße vom marabu