Similar to what we have seen with the TListBox component (previously in this chapter), we can easily customize TTreeView items by dropping other components inside them. Adding an extra button to a specific item merely requires selecting the items and double-clicking on the TButton entry in the Component Palette of the IDE.
A second way to customize your items (exactly as described for TListBox items) is to inherit your own class from TTreeViewItem and provide extra functionalities or onboard components directly via code.
The following code snippets show how to implement a simple tree view item that is able to hold some extra data (specifically, a TPerson record data structure):
TPerson = record
Name: string;
Surname: string;
DateOfBirth: TDate;
function Age: Integer;
function ToString: string;
class function Andrea: TPerson; static;
end;
{ TPerson }
function TPerson.Age: Integer...