Welcome

首页 / 软件开发 / Delphi / Delphi TTreeView学习(二)-- TTreeNodes

Delphi TTreeView学习(二)-- TTreeNodes2012-01-11 博客园 云中君需要了解的属性:
Countproperty Count: Integer;

Use Count to determine the number of tree nodes in the tree view that owns the tree nodes object. Count provides an upper bound when iterating through the entries in the Item property array.
Handleproperty Handle: HWND;

Use Handle to obtain the handle of the tree view that owns the tree nodes object.
Itemproperty Item[Index: Integer]: TTreeNode; default;

Use Item to access to a node by its position in the tree view. The first node has an index of 0, the second an index of 1, and so on.

Item is the default property for TTreeNodes. This means that the name of the Item property can be omitted when indexing into the set of tree nodes. Thus, the line

FirstNode := TreeView1.Items.Item[0];

can be written

FirstNode := TreeView1.Items[0];
Ownerproperty Owner: TCustomTreeView;

Use the Owner property to access the tree view control that displays the nodes maintained by the TTreeNodes object.