TTreeView/es: Difference between revisions

From Free Pascal wiki
Jump to navigationJump to search
Line 1: Line 1:
==Añadiendo un nuevo elemento mediante código ==
==Añadir un nuevo elemento mediante código==


Se puede añadir un nuevo elemento mediante TTreeView.Items.AddChild o bien  AddChildObject.
Se puede añadir un nuevo elemento mediante TTreeView.Items.AddChild o bien  AddChildObject.

Revision as of 15:00, 10 January 2014

Añadir un nuevo elemento mediante código

Se puede añadir un nuevo elemento mediante TTreeView.Items.AddChild o bien AddChildObject.

Crear un TreeView que carga elementos solamente cuando se expande

To add the expansion symbol to a node without subitems use:

MyNode.HasChildren := True;

And then set an event handler for the OnExpanding event. In this even you should return if the expansion can actually be made or not and when yes, you should add subitems to the node. If the expansion cannot be done, the expansion symbol will be automatically removed even if you have previously set HasChildren to true.