From RAD Studio API Documentation
Jump to: navigation, search


function ItemAtPos(Pos: TPoint; Existing: Boolean): Integer;


int __fastcall ItemAtPos(const System::Types::TPoint &Pos, bool Existing);


Type Visibility Source Unit Parent
function public
Vcl.StdCtrls TCustomListBox


Returns the index of the list box item indicated by the coordinates of a point on the control.

Use ItemAtPos to detect if an item exists at a particular point in the control.

The Pos parameter is the point in the control in window coordinates. If Pos is beyond the last item in the list box, the value of the Existing variable determines the returned value. If Existing is set to true, ItemAtPos returns -1, indicating that no item exists at that point. If Existing is set to false, ItemAtPos returns the index of the last item in the list box plus one.

See Also

Code Examples