Ho provato ma mi parte il showmessage continuamente :-[
.
.
procedure TForm1.StringGrid1SelectCell(Sender: TObject; aCol, aRow: Integer;
var CanSelect: Boolean);
var col,riga:integer;
begin
col:=StringGrid1.Col;
riga:=StringGrid1.Row;
Showmessage ('Testo '+inttostr(riga));
end;
procedure TForm1.StringGrid1EditingDone(Sender: TObject);
var col,riga:integer;
begin
showmessage('fatto on editing done');
col:=StringGrid1.Col;
riga:=StringGrid1.Row;
Showmessage ('col '+inttostr(col)+' riga '+inttostr(riga));
Showmessage ('Testo '+StringGrid1.Cells[col,riga]);
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
StringGrid1.Cells[4,4]:='Prova';
end;
Faccio il copia & incolla da un progetto funzionante.
Quando faccio il "doppio click" su una riga selezionata, parte il codice qui sotto:
procedure TForm1.TabellaEsitiDblClick(Sender: TObject);
var Idx:Integer;
begin
Idx:=TabellaEsiti.Row;
if (Idx > 0) then begin
if (TabellaEsiti.Cells[ColDaScar, Idx] = CstSelz) then begin
TabellaEsiti.Cells[ColDaScar, Idx]:=CstNonSelz;
TotFilesDaScar:=TotFilesDaScar - 1;
TotBytesDaScar:=TotBytesDaScar - ConvertiNumero(TabellaEsiti.Cells[ColSize, Idx]);
end else begin
TabellaEsiti.Cells[ColDaScar, Idx]:=CstSelz;
TotFilesDaScar:=TotFilesDaScar + 1;
TotBytesDaScar:=TotBytesDaScar + ConvertiNumero(TabellaEsiti.Cells[ColSize, Idx]);
end
end;
end;
Ciao, Mario