Einzelnen Beitrag anzeigen

Hobby-Programmierer

Registriert seit: 19. Jan 2006
Ort: München
392 Beiträge
 
Delphi XE Starter
 
#7

Re: StringGrid und das 1 mal 1

  Alt 8. Mär 2007, 20:43
Nabend ...,
mit fester Zeile/Spalte sähe es dann so aus
Delphi-Quellcode:
procedure TForm1.ButtonClick(Sender: TObject);
var iCol, iRow, iFaktor: Integer;
begin
  Faktor:= 1; // 10,20,30...100... evtl. SpinEdit.Value;

  with StringGrid do begin
    FixedCols:= 1;
    FixedRows:= 1;
    iFaktor:= iFaktor -1;

    for iCol:=1 to 10 do begin
      Cells[iCol,0]:= IntToStr(iCol + iFaktor); // FixedCell
      for iRow:=1 to 10 do begin
        Cells[0,iRow]:= IntToStr(iRow + iFaktor); // FixedCell
        Cells[iCol,iRow]:= IntToStr((iCol + iFaktor) * (iRow + iFaktor));
      end;
    end;

  end;
end;
LG Mario
Mario
'Lesen Sie schnell, denn nichts ist beständiger als der Wandel im Internet!'
  Mit Zitat antworten Zitat