在DBGrid的OnMouseDown事件里就可以得到:
procedure TForm1.DBGrid1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
iCol: Integer;
begin
with DBGrid1 do begin
iCol := MouseCoord(X, Y).X;
if (iCol > 0) and (iCol <= Columns.Count) then begin
Self.Caption := Format('列序号: %d 列标题: %s', [iCol, Columns[iCol -1].Title.Caption]);
end;
end;
end;
DBGridEh好像不是免费的哦^?^