Einzelnen Beitrag anzeigen

jan001

Registriert seit: 31. Mär 2009
10 Beiträge
 
#1

TStringGrid in Delphi7 und XE

  Alt 16. Sep 2013, 08:24
In Delphi7 funktioniert StringGrid1.Cells[] und Form1.StringGrid1.Cells[] einwandfrei. In XE4-5 werden die Werte mit Form1.StringGrid1.Cells[] nicht angezeigt. Gibt es eine Lösung?

Delphi-Quellcode:
procedure TForm1.FormActivate(Sender: TObject);
var
  n : integer;
begin
StringGrid1.RowCount:= 5;
StringGrid1.ColCount:= 3;
StringGrid1.Cells[0,0]:= 'LNr';
for n:= 1 to 4 do begin
  StringGrid1.Cells[0,n]:= IntToStr(n);
  StringGrid1.Cells[1,n]:= IntToStr(n*10);
  StringGrid1.Cells[2,n]:= IntToStr(n*100);
end;
end;

procedure TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
Label1.Caption:= StringGrid1.Cells[StringGrid1.Col,StringGrid1.Row];
Label2.Caption:= Form1.StringGrid1.Cells[Form1.StringGrid1.Col,Form1.StringGrid1.Row];
end;
  Mit Zitat antworten Zitat