Dear ALL,
I have what looks like a "simple" question, but after some hours googling and browsing the documentation, I could not find any adequate answer for it.
I have a simple TreeView as follows:
Parent 1
(x) Child 1
( ) Child 2
( ) Child 3
Parent 2
Parent 3
( ) Child 1
(x) Child 2
Parent 4
Child 1
(... and so on...)
Some parent nodes have siblings, other do not. Many of the siblings have checkboxes, but a few do not.
What I want is: (1) for a given Selected node (eg., Parent 1), check if the node has parents *with* checkboxes; (2) if ("and only if", as mathematicians like to say) the Selected node has siblings and they are checkable, get the Text of the checked siblings.
I know the Selected and Text properties of TreeNode, and presume the algorithm should be implemented more or less like this:
var
PNode, SNode: TTreeNode;
AText: string;
begin
PNode := TTreeView1.Selected; {... get the currently selected node }
if PNode.HasChildren then {... check if PNode has siblings }
begin
{... check if the siblings have checkboxes }
{... if they have chackboxes, get the text of the sibliings }
{ AText := SNode.Text; }
end;
end;
But I could not proceed beyond that point.
Thanks in advance for any assiatence you can provide.