[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomTreeView.LoadFromFile

Loads tree nodes from the specified file.

## Declaration

Source position: comctrls.pp line 3729

`public procedure TCustomTreeView.LoadFromFile(`
`const FileName: string`
`);`

## Arguments

`FileName` |  | File name with the tree node data loaded in the method.

## Description

LoadFromFile is a method used to load the tree nodes from the specified file name into the Items property. FileName is a qualified file name which contains the textual representation for the tree node hierarchy generated using SaveToFile.

Each tree node in FileName is represented using leading Tab (#9) characters for the Level in the tree node, followed by the Text for the node and an end-of-line sequence (#13#10). TTreeNode instances are created and added to the Items property when the node values are read from the file.

Use SaveToFile to store the textual representation for tree nodes in Items to a given file name.

Use SaveToStream and LoadFromStream to read and write the node hierarchy using stream-based storage.

## See also

TCustomTreeView.Items |  | The container with the TTreeNode instances for the control.
TCustomTreeView.SaveToFile |  | Saves the tree nodes in Items to the specified file.
TCustomTreeView.SaveToStream |  | Saves the tree nodes in Items to the specified stream.
TCustomTreeView.LoadFromStream |  | Loads tree nodes from the specified stream.
TTreeNode.Level |  | The number of ancestor nodes for the current tree node.
TTreeNode.Text |  | Text displayed for the tree node.
TTreeNodes |  | Implements a container for TTreeNode instances.