Ich habe nur in der Resize-Methode ein ScaleBy:
Delphi-Quellcode:
// Hochskalieren
procedure TfrmMain.scaleUp;
begin
lastWS := 1;
oldW := Self.Width;
Self.ScaleBy(scaleF,90);
end;
procedure TfrmMain.scaleDown;
begin
lastWS := -1;
Self.ScaleBy(90,scaleF);
Self.Width := oldW;
end;
procedure TfrmMain.FormResize(Sender: TObject);
begin
// beim Starten nicht skalieren
if NOT scale then begin
scale := True;
lastWS := -1;
exit;
end;
case WindowState of
wsNormal: if lastWS = 1 then scaleDown;
wsMaximized: if lastWS = -1 then scaleUp;
end;
frmMain.Repaint;
end;