為DBGrid加上OnClick事件

很奇怪的在DBGrid竟然沒有OnClick事件~不過還是可以用方式讓Click事件重見天日

private
    { Private declarations }
    procedure dbgrid1Click(Sender:Tobject);
procedure TForm1.FormCreate(Sender: TObject);
begin
  dbgrid1.ControlStyle := dbgrid1.ControlStyle + [csClickevents];
  TForm(dbgrid1).OnClick := dbgrid1click;
end;
procedure TForm1.dbgrid1Click(Sender: Tobject);
begin
  // Click事件
end;