listview GetColumnAt method
Return to Introduction  Previous page  Next page
Applies to
acListView and acDBListView components.  

Declaration
function GetColumnAt(X: Integer): TListColumn;  

Description
The GetColumnAt method returns the list column at the specified X-coordinate.  
 
Call GetColumnAt to obtain the TListColumn object for the list item found at the position specified by the X parameter. X specify the coordinate of the position, in pixels, relative to the top left corner of the list view. If there is no item at the location, GetColumnAt returns nil.  

Example
procedure TForm1.acListView1MouseDown(Sender: TObject;  
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);  
var  
  Column: TListColumn;  
begin  
  Column := acListView1.GetColumnAt(X);  
  if Column <> nil then  
    Caption := Column.Caption;  
end;  

See also
GetItemAt method.