Vcl.StdCtrls.TCustomListBox.ItemAtPos
Delphi
function ItemAtPos(Pos: TPoint; Existing: Boolean): Integer;
C++
int __fastcall ItemAtPos(const System::Types::TPoint &Pos, bool Existing);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Vcl.StdCtrls.pas Vcl.StdCtrls.hpp |
Vcl.StdCtrls | TCustomListBox |
Description
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