onItem (Callback)


onItem (idControl, event, parameter)

This callback is invoked when the user performs an action on an item in a list view or tree view control

Parameter Description
idControl The unique id of the control that triggered the callback
event The event code, see remarks for a list of event codes
param This parameter is defined for some event codes

Returns

0

Remarks

This is a callback function. You must supply it yourself. To register this callback, use the WinXRegOnItem function.

The event parameter will be one of these constants:

$$NM_CLICK
A single click of the left mouse button
$$NM_DBLCLK
A double click of the left mouse button
$$NM_RCLICK
A single click of the right mouse button
$$NM_RDBLCLK
A double click of the right mouse button
$$NM_RETURN
A press of the return or enter key
$$NM_HOVER
The user hovered the mouse over the control
$$NM_KEYDOWN
A press of any key besides return or enter. If the event parameter is $$NM_KEYDOWN the param parameter will be the VK code of the key that was pressed.

Examples

' A very simple onItem callback. Detects single clicks
FUNCTION onItem (idControl, event, param)

IF event = $$NM_CLICK THEN PRINT "CLICK!"

END FUNCTION

Related Links

List View Controls
Tree View Controls
WinXRegOnItem