[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomListView.CanChange

Indicates whether a change notification can be applied for an item on the list view control.

## Declaration

Source position: comctrls.pp line 1531

`protected function TCustomListView.CanChange(`
`AItem: TListItem;`
`AChange: Integer`
`):Boolean;`

## Arguments

`AItem` |  | List item with the modified value examined in the method.
`AChange` |  | Indicates which value in the list item has been modified. Corresponds to the ordinal values in the TItemChange enumeration.

## Function result

Returns True if the modified value in the list item is accepted.

## Description

CanChange is a Boolean function used to determine whether a change notification message for an item in a list view control can be accepted and applied. CanChange is called from the widgetset class instance, and occurs when change notification messages are handled for the list view control.

CanChange signals the OnChanging event handler (when assigned) to determine the return value for the method. The return value is True if the changed value in AItem is accepted and can be applied to the list item. The return value is False if the modification is rejected in the OnChanging event handler.

Remark: | Interestingly, the return value is True if AChange contains an Integer value that is not represented in the TItemChange enumeration. In this case, the OnChanging event is not signalled.

In the current LCL implementation, CanChange and OnChanging apply to the Windows widgetset only. Other platforms do not currently generate change notifications for item values.

## Version info

Added in LCL version 4.0.

## See also

TCustomListView.OnChanging |  | Event handler signalled when a change notification is received for a list item.
TLVChangingEvent |  | Defines an event handler signalled when a widgetset class is updating an item on a list view control.
TItemChange |  | TItemChange - enumerated type for kind of change: in text, in image, or in state.