你说的行号是指组件上的第几行?还是数据表里的第几行?如是指组件上的第几行,如下:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, StdCtrls, ADODB, DBGrids, Grids;type // 同一单元内可访问其它声明类的受保护属性 TDBGrid = class(DBGrids.TDBGrid) {public property Row; end}; TForm1 = class(TForm) DBGrid1: TDBGrid; ADOQuery1: TADOQuery; DataSource1: TDataSource; procedure DBGrid1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.DBGrid1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);begin Caption := Format('当前行号为:%d.', [DBGrid1.Row]);end;end.