Hallo
Ich zeige dir einfach mal wie ich das Löse:
Delphi-Quellcode:
////////////////////////////////////////////////////////////////////////////////
// Procedure : Tfrm_CustomerChoise.VSTGetImageIndex
// Comment : Icons im VST anzeigen
// Parameter : Sender - VST
// Node - Knoten
procedure Tfrm_CustomerChoise.VSTGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex;
var Ghosted: Boolean; var ImageIndex: Integer);
var
Data: PTreeData;
begin
Data := Sender.GetNodeData(Node);
case Kind of
ikNormal, ikSelected:
if (Column = 0) and (Node.Parent = Sender.RootNode) then
ImageIndex := TTreeDataClass(Data.FObject).Icon;
ikState:
case Column of
0:
if Node.Parent <> Sender.RootNode then ImageIndex := 0;
end;
end;
end;
Gruss