Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi StringGrid.ScaleBy(x,y) scaled nicht ColWidth & RowHeight! (https://www.delphipraxis.net/11925-stringgrid-scaleby-x-y-scaled-nicht-colwidth-rowheight.html)

Rumpi 17. Nov 2003 09:33


StringGrid.ScaleBy(x,y) scaled nicht ColWidth & RowHeigh
 
Hallo,

Ich bekomme es nicht hin, dass auch ein TStringGrid ( D7 ) die
ColWidth und die RowHeight scaled.

Gibts da eine Lösung für?

mfg Rumpi

Rumpi 17. Nov 2003 21:44

Re: StringGrid.ScaleBy(x,y) scaled nicht ColWidth & RowH
 
Hi,

zu Info (D7) die neue Form Height und Width muss man nach ScaleBy setzen!
Delphi-Quellcode:
const
  DesHeight = 768;
  DesWidth = 1024;
...

procedure TForm1.WMDisplayChange(var msg: TMessage);
begin
  DoScale;
end;

procedure TForm1.OnCreate(Sender: TObject);
begin
  Height := DesHeight;
  Width := DesWidth;
  DoScale;
end;

procedure TForm1.OnResize(Sender: TObject);
begin
  DoScale;
end;

procedure TForm1.DoScale;
var
  x, y : Longint;
begin
  Scaled := True;    // just in case it is not enabled
  x := Screen.Width; // get the new Width
  y := Screen.Height; // get the new Height

  // scale ? 
  if (y <> Height) or (x <> Width) then
  begin
    if (x <> Width) then
      ScaleBy(x, Width)
    else
      ScaleBy(y, Height);
   
    Height   := y;
    Width    := x;
  end;
end;
das Problem mit den StringGrid besteht immer noch.

mfg Rumpi


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz