Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 11.01.08 18:51 
Hi, Delpher,

(wie) kann ich - nachträglich - in einem Programm die Form- und Komponentengrößen komfortabel an verschiedene Bildschirmauflösungen anpassen? Erstellt habe ich das Programm unter 1024 x 768.

Danke für Hilfe,
Detlef
Mike19
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 256

Win XP, Vista, Win 7
Delphi 2005, Turbo Delphi
BeitragVerfasst: Fr 11.01.08 19:30 
Hallo,

versuchs mal damit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
const
  ScreenHeightDev = 768;//Diese Werte anpassen
  ScreenWidthDev  = 1024;

procedure TForm1.FormCreate(Sender: TObject);
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 ;
      scaleBy(x, ScreenwidthDev);
    end;
end;



ist aber nicht getestet

Gruß Micha
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Fr 11.01.08 22:04 
Hi, Micha,

denn mach ich das jetzt mal!

Vielen Dank for the moment, melde mich (morgen) wieder,
Detlef