procedure TForm1.DBGrid1DblClick(Sender: TObject);
begin
if dbgrid1.SelectedIndex=2 then
begin
form2:=tform2.Create(self);
form2.ShowModal;
form2.Free;
end;
end;
ontitleclick(标题)oncellclick(单元格)
事件
case column.Index of 1:showmessage('it's column2');
2:showmessage('it's column3');
end;
或在ondbclick
case dbgrid1.selectedindex of 1:
2:
end;