TVirtualStringTree.OnMeasureItem Event

Virtual Tree View

Miscellaneous event.

Pascal
property OnMeasureItem: TVTMeasureItemEvent;
Description

Virtual Treeview supports individual node heights. However it might sometimes unpractical to set this height in advance (e.g. during OnInitNode). Another scenario might be that multi line nodes must size themselves to accomodate the entire node text without clipping. For such and similar cases the event OnMeasureItem is for. It is queried once for each node and allows to specify the node's future height. If you later want to have a new height applied (e.g. because the node's text changed) then call InvalidateNode for it and its vsHeightMeasured state is reset causing so the tree to trigger the OnMeasureItem event again when the node is painted the next time. 

 

See Also

InvalidateNode, vsHeightMeasured

Class
Links
What do you think about this topic? Send feedback!