双击DBGrid记录行时在DBGridDBLClick事件中弹出一个窗体,但是在双击标题行时并不触发这个dblClick事件,应该怎么写代码?
http://www.delphi2007.net/DelphiDB/html/delphi_20061216114740273.html
rt
写在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;