Hello!
Please explain from time to time?
Yes, you can change the node icon, you can do this in collection based mode by directly changing the ExpandedNodeIcons or CollapsedNodeIcons property or via events.
The code access the expanded node icon is
AdvTreeView1.Nodes[0].ExpandedIcons[0, False].LoadFromFile('MyImage.png');
AdvTreeView1.Nodes[0].CollapsedIcons[0, False].LoadFromFile('MyImage.png');
Pieter Scheldeman2018-04-26 16:36:20
And how it's will be in c++ builder syntax?
Sorry for previous q. Problem solved.
Thank you for your feedback.
I also have a question on this subject, so I'll continue to write here.
Via AfterSelectNode I get aNode.node .
procedure ctv_directoriesAfterSelectNode
if Assigned(ANode.Node) then
begin
nNode:= ANode.Node;
GetCursorPos(point);
pm_Type.Popup(Point.X,Point.Y);
end;
I can use this to change the text in a column using a pop-up menu: nKnoten.Text[4]:=' ' (aNode.node) change the text.
Now how do I manage to change the icon of exactly these nodes?
if (Sender as TMenuItem).Caption = 'Correspondence' then
begin
// set new entry
cb_Font.Checked:= true;
nKnoten.Text[4]:= 'Correspondence';
? node.ImageIndex := 0; -> I'm looking for something like that
end;
Thanks
Mike
The Icon can be assigned to the CollapsedIcon / ExpandedIcon property. If you only assign the CollapsedIcon, this will be used for both states. If you have assigned a TPictureContainer, you can use CollapsedIconName instead.
Sorry, I only saw this now. Thanks for the help.
Mike