Autor Beitrag
Fischman
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Sa 06.08.05 07:36 
Hallo und einen guten Morgen hier,

Wie kann ich,wenn mein Programm bei verschiedenen Bildschirmauflösungen immer sich der Größe samt Inhalt anpasst.Also mit allen Editfeldern usw.So wenn zum Beispiel Kumpel a mit einer Auflösung von 800 * 600 sieht und der ander höher aber mal ist die Form groß woanders zu klein.Gibt es da auch einen guten Tip.

Gruß Uwe
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Sa 06.08.05 08:37 
Durch eine Suche mit Suche in: Delphi-Forum, Delphi-Library BILDSCHIRMAUFLÖSUNG komme ich dazu:
ausblenden Quelltext
1:
2:
hoehe:=screen.height;
breite:=screen.width;

ermittelt die aktuelle Bildschirmauflösung.
Mit diesen Werten kannst Du dann die Komponenten relativ arbeiten.
z.b.
ausblenden Quelltext
1:
form1.width:=screen.width/2					
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Sa 06.08.05 14:49 
werd ich mal ausprobieren.

Gruß
Fischman Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 137

Win XP
D3 Prof / D7
BeitragVerfasst: Di 09.08.05 11:01 
So hier hab was aus ein Delphi3buch,ist ja so nicht schlecht aber auch nicht das Richtige.Ich wollte noch sagen falls wem`s stört die Codefuntion zum einfügen funktioniert bei mir nicht.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
const ScreenHeightDev = 768;
      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.heigth-Form1.Clientheigth;
ScaleBy(x,ScreenWidthDev);
end;
end;


Gruß Uwe

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.