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

# TCustomListView.GetItemAt

Finds and return the list item at the specified coordinates.

## Declaration

Source position: comctrls.pp line 1639

`public function TCustomListView.GetItemAt(`
`x: Integer;`
`y: Integer`
`):TListItem;`

## Arguments

`x` |  | Horizontal coordinate for the requested list item.
`y` |  | Vertical coordinate for the requested list item.

## Function result

List item found at the specified coordinates, or Nil if a list item is not found.

## Description

GetItemAt is a TListItem function used to get the list item which is located at the coordinates specified in X and Y. GetItemAt calls the corresponding method in the widgetset class instance to get the index position for the list item at the coordinates.

The return value contains the TListItem instance in Items indicated by the widgetset class. The return value may be Nil if the coordinates are not within an item found on the list view control, or the handle for the widget has not been allocated.

GetItemAt is used to implement methods like GetNearestItem.