En ne permettant l'édition qu'en cas de clic dans la colonne du milieu, par exemple.
procedure TForm1.MonStringGridMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var Col: Longint; ClientPoint, ScreenPoint: TPoint; begin GetCursorPos(ScreenPoint); ClientPoint := (Sender as TStringGrid).ScreenToClient(ScreenPoint); (Sender as TStringGrid).MouseToCell(ClientPoint.X, ClientPoint.Y, Col, Row); if col=1 then Begin OnPeutEcrire; End else Begin OnPeutPasEcrire; End; End;
NON TESTE.
RMD
www.Logiciels-RMD.com
|