oullafff
Messages postés29Date d'inscriptionmardi 19 août 2003StatutMembreDernière intervention20 avril 2004
-
18 nov. 2003 à 09:39
cs_RMD
Messages postés84Date d'inscriptionmercredi 25 septembre 2002StatutMembreDernière intervention21 mai 2004
-
18 nov. 2003 à 17:32
Oullafff
Bonjour,
Ma question est la suivante:
J'utilise une StringGrid, celle-ci a trois colonnes, et il faut que je puisse modifier le texte contenu dans la colonne du milieu, mais pas dans les deux autres...
cs_RMD
Messages postés84Date d'inscriptionmercredi 25 septembre 2002StatutMembreDernière intervention21 mai 2004 18 nov. 2003 à 17:32
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;