RAD Studio VCL Reference
|
Returns the next child node after Value.
Call GetNextChild to locate the next node in the list of immediate children of the tree view node. If the calling node has no children or there is no node after Value, GetNextChild returns nil (Delphi) or NULL (C++).
C++ Examples:
/* The following code tests to see if the currently selected item has a sibling; if so, HasSibling will be set to true. */ 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"; }
Delphi Examples:
{ The following code tests to see if the currently selected item has a sibling; if so, HasSibling will be set to true. } procedure TForm1.Button1Click(Sender: TObject); var HasSibling: Boolean; SelNode: TTreeNode; ParentNode: TTreeNode; begin SelNode := TreeView1.Selected; ParentNode := SelNode.Parent; HasSibling := (ParentNode.GetPrevChild(SelNode) <> nil) or (ParentNode.GetNextChild(SelNode) <> nil); if (HasSibling) then Edit1.Text := 'True' else Edit1.Text := 'False'; end;
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|