procedure TForm1.MaximizeAndScale;
var
sWidth: Double;
sHeight: Double;
begin
sWidth := Screen.MonitorFromWindow(
Handle).Width / Width;
sHeight := Screen.MonitorFromWindow(
Handle).Height / Height;
if sWidth < sHeight
then
begin
ScaleBy(Round(Screen.MonitorFromWindow(
Handle).Width * 1.02), Width);
end
else
begin
ScaleBy(Round(Screen.MonitorFromWindow(
Handle).Height * 1.02), Height);
end;
//WindowState := wsMaximized;
end;
procedure TForm1.scaleform;
const breite=1440;
{Auflösung, unter der das Fenster erstellt wurde}
hoehe=900;
var schrift: integer;
begin
schrift := pixelsperinch-96;
if screen.width>breite
then begin
if schrift>0
then
{für große Schriften}
ScaleBy(round(((screen.width/breite)*100)-((screen.width/breite-1)*100)),100)
else
{für kleine Schriften}
ScaleBy(round(((screen.width/breite)*100)),100);
end
else begin
if screen.width=breite
then
ScaleBy(round(((screen.width/breite)*100)-schrift),100)
else begin
if schrift>0
then
{für große Schriften}
ScaleBy(round((100-(breite/screen.width-1)*100)-(breite/screen.width-1)*100),100)
else
{für kleine Schriften}
ScaleBy(round((100-(breite/screen.width-1)*100)),100);
end;
end;
WindowState := wsMaximized;
end;
procedure tform1.ScaleForme;
const
screenwidthdev = 1440;
// Einstellungen auf dem Entwicklungsrechner
screenheightdev = 900;
// dito
var
x,y:integer;
begin
//scaled := true;
x:= Screen.width;
y:= Screen.Height;
if(y <> ScreenHeightDev)
or (x <> ScreenwidthDev)
then
begin
Form1.Height := (Form1.ClientHeight* y
div ScreenHeightDev) +
Form1.Height- Form1.ClientHeight;
Form1.Width := (Form1.ClientWidth * x
div ScreenWidthDev) +
Form1.Height - Form1.ClientHeight;
begin
form1.ScaleBy(x,Screenwidthdev);
end;
end;
end;