folderlistview GetItemAt method
Return to Introduction  Previous page  Next page
Applies to
dcFolderListView component.  

Declaration
function GetItemAt(X, Y: Integer): TListItem;  

Description
The GetItemAt method returns the list item at the specified position.  
 
Call GetItemAt to obtain the TListItem object for the list item found at the position specified by the X and Y parameters. X and Y specify the coordinates of the position, in pixels, relative to the top left corner of the list view. If there is no item at the location, GetItemAt returns nil.  

Example
procedure TForm1.dcFolderListView1MouseDown(Sender: TObject;  
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  
var  
  Item: TListItem;  
begin  
  Item := dcFolderListView1.GetItemAt(X, Y);  
  if Item <> nil then  
    Caption := Item.Caption;  
end;  

See also
GetColumnAt method.