GetPrevChild (C++)
Description
The following code tests whether the currently selected item has a sibling; if so, HasSibling is set to True.
Code
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TTreeNode *SelNode = TreeView1->Selected;
TTreeNode *ParentNode = SelNode->Parent;
bool HasSibling = (ParentNode->GetPrevChild(SelNode) ||
ParentNode->GetNextChild(SelNode));
if (HasSibling) Edit1->Text = "True";
else Edit1->Text = "False";
}
Uses
- Vcl.ComCtrls.TTreeNode.Parent ( fr | de | ja )
- Vcl.ComCtrls.TTreeNode.GetNextChild ( fr | de | ja )
- Vcl.ComCtrls.TTreeNode.GetPrevChild ( fr | de | ja )