全部博文(788)
分类:
2009-05-12 16:04:35
写在OnCellClick
type
TForm1 = class(TForm)
DBGrid1: TDBGrid;
ADOTable1: TADOTable;
DataSource1: TDataSource;
procedure DBGrid1DblClick(Sender: TObject);
procedure DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
GC: TGridCoord;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin
if (GC.X > 0) and (GC.Y > 0) then
begin
ShowMessage('DBCLICK');
end;
end;
procedure TForm1.DBGrid1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
GC := DBGrid1.MouseCoord(x, y);
end;