很奇怪的在DBGrid竟然沒有OnClick事件~不過還是可以用方式讓Click事件重見天日
[pascal]
private
{ Private declarations }
procedure dbgrid1Click(Sender:Tobject);
[/pascal]
[pascal]
procedure TForm1.FormCreate(Sender: TObject);
begin
dbgrid1.ControlStyle := dbgrid1.ControlStyle + [csClickevents];
TForm(dbgrid1).OnClick := dbgrid1click;
end;
[/pascal]
[pascal]
procedure TForm1.dbgrid1Click(Sender: Tobject);
begin
// Click事件
end;
[/pascal]