Skip to content

ItemData - AbstractTreeView

Retrieves or stores a custom tree item value

Type: Property
Access: Read/Write
Data Type: Longptr
Parameters: None

Parameters

Parameter Type Description
hItem Handle Item handle

Syntax

Property Longptr ItemData
Access Type Syntax
Read Access: Get ItemData to LongptrVariable
Write Access: Set ItemData to LongptrVariable/Value

Description

Each item in the control can have a 32-bit integer associated with it. You can use ItemData to store a custom value such as an array item reference or object ID, etc. This property gets and sets the custom data value you associated with the item.

Sample

This sample shows how to retrieve the ItemData of a tree item when the user clicks that tree item and use it to execute an action.

This sample does not contain proper checking of array size or that the array value exists, it is intended only as a sample of what you can use ItemData for.

String[] sValues

Procedure OnItemClick Handle hItem Boolean ByRef bCancel
    Integer iRef
    String sValue

    Get ItemData hItem to iRef
    Send Info_Box sValues[iRef] "Value"
End_Procedure