Vcl.ComCtrls.TTreeNode.HasAsParent

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function HasAsParent(Value: TTreeNode): Boolean;

C++

bool __fastcall HasAsParent(TTreeNode* Value);

Properties

Type Visibility Source Unit Parent
function public
Vcl.ComCtrls.pas
Vcl.ComCtrls.hpp
Vcl.ComCtrls TTreeNode

Description

Returns True if Value is the parent node of the calling node.

Use the HasAsParent method to determine whether the given node is parent to the calling node. HasAsParent returns True if Value is the parent node of the calling node, False otherwise.

The given node can be on any level above the calling node but if it is the parent for the calling node, HasAsParent will return True.

if Node1.HasAsParent(Node2) then
  ShowMessage(Node1.Text + ' has ' + Node2.Text + ' as parent');

Note: In the snippet above, Node1 and Node2 are of type TTreeNode.

See Also