Sign in Join
FPDoc Onlineexperiment

TCustomTreeView.SaveToFile procedure

Member of TCustomTreeViewpublicIn unit ComCtrls

Saves the tree nodes in Items to the specified file.

Declaration

pascal
procedure SaveToFile(const FileName: string)

Description

SaveToFile is a method used to save the tree nodes in Items to the specified file name. FileName is a qualified path to the file on the local file system where the tree node data is stored. If FileName already exists, it is recreated and previous values in the file are lost.

SaveToFile visits each of the TTreeNode instances in Items and writes a textual representation for the tree nodes to the file. Each tree node is represented by leading Tab (#9) characters to denote the Level for the tree node, followed by the Text for the node and an end-of-line sequence (#13#10).

Use LoadFromFile to load and recreate the tree nodes for the control from the file created in the method.

Use SaveToStream and LoadFromStream to read or write tree node information using stream-based storage.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.