GetItemAtPointer

Description

Gets the handle or the index of the item under the cursor.

Applies to

ListView controls, TreeView controls

Syntax

controlname.GetItemAtPointer (  )

Argument

Description

controlname

The name of the control whose handle or index you want to obtain.

Returns

Long. Returns the index (ListView) or handle (TreeView) of the item under the cursor. Returns -1 for failure.

Usage

System events that select an item in a ListView or TreeView control, such as the Clicked event, already have an argument that passes the index for the ListView or the handle for the TreeView. The GetItemAtPointer function allows you to retrieve the index or handle in user events (or system events without an index or handle argument) for a ListView or TreeView control.

Examples

Example 1

This example places the handle of a TreeView item in a SingleLineEdit box:

integer li_index


li_index= tv_1.GetItematPointer ( )

sle_1.text = string (li_index)

See also