StringGrid edition colonne

oullafff Messages postés 29 Date d'inscription mardi 19 août 2003 Statut Membre Dernière intervention 20 avril 2004 - 18 nov. 2003 à 09:39
cs_RMD Messages postés 84 Date d'inscription mercredi 25 septembre 2002 Statut Membre Dernière intervention 21 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...

Comment faire...?

Merci

1 réponse

cs_RMD Messages postés 84 Date d'inscription mercredi 25 septembre 2002 Statut Membre Dernière intervention 21 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;

NON TESTE.

RMD

www.Logiciels-RMD.com
0
Rejoignez-nous