this slowpoke moves

StringGrid Cells Zoom

private
    { Private declarations }
    procedure gridZoom(FFact: Real);
    
//

procedure TForm1.gridZoom(FFact: Real);
var
  x: Integer;
begin
  for x := 0 to StringGrid1.colcount - 1 do
    StringGrid1.colwidths[x] := round(StringGrid1.colwidths[x] * FFact);

  for x := 0 to StringGrid1.RowCount - 1 do
    StringGrid1.rowheights[x] := round(StringGrid1.rowheights[x] * FFact);

  StringGrid1.Font.Size := round(StringGrid1.rowheights[0] * 0.65);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  gridZoom(1.1);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  gridZoom(0.9);
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate