Sign in Join
FPDoc Onlineexperiment

TCustomListView.GetNearestItem function

Member of TCustomListViewpublicIn unit ComCtrls

Locates the list item closest to the specified position.

Declaration

pascal
function GetNearestItem(APoint: TPoint; Direction: TSearchDirection)
: TListItem

Arguments

APoint

TPoint instance with the coordinates examined in the method.

Direction

Search direction when trying to locate the nearest list item.

Function result

List item closest to the specified point, or Nil if a list item is not found.

Description

GetNearestItem is used to locate a list item from a position specified in pixel coordinates relative to the top left corner of the list view. It starts looking at the position specified by the Point parameter, and moves in the direction indicated by the Direction parameter until it locates a list item. If no item is found Nil is returned.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.