Autor Beitrag
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 12.05.06 20:55 
Ich will ein Programm schreiben wo eine Komponente (Ein TImage) immer unten rechts angezeigt wird. Auch wenn der Anwender das Fenster maximiert soll die Komponemte mit nach unten rechts gehen und nicht an der Stelle stehen bleiben wo sie im Verkleinerten Fenster gestanden hat.
Kann mir da jemand weiterhelfen???
Danke im Voraus :?:
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 12.05.06 20:57 
Du musst im OnResize-Ereignis die Eigenschaften top und left des Images ändern:
ausblenden Delphi-Quelltext
1:
2:
image1.left:=screen.width-image1.width;
image1.top:=screen.height-image1.height;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 12.05.06 21:01 
Danke, aber wo genau muss ich den Code einbauen (Ich bin noch Anfänger)
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 12.05.06 21:05 
Ich glaube ich habe dich falsch verstanden. Mit unten Rechts meinst du nicht unbedingt in der Ecke des Bildschirms sondern der Form?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 12.05.06 21:06 
Ich meine das unten Rechts der Form...
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 12.05.06 21:13 
Jetzt wird die Komponente durchgehend unten rechts der Form1 angezeigt auch wenn das Fenster verkleinert ist. Was hab ich falsch gemacht?
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 12.05.06 21:15 
Du wählst im Objektinspektor Form1 aus und klickst dann auf Ereignisse. Dort suchst du dir OnResize und klickst doppelt auf das leere Feld rechts daneben. Der Code, den du jetzt eintippst, wird jedes mal ausgeführt, wenn sich die Größe des Formulars verändert. Hier der Quelltext:
ausblenden Delphi-Quelltext
1:
2:
image1.left:=form1.width-image1.width;
image1.top:=form1.height-image1.height;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Barzi
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 12.05.06 21:20 
Sehr gut... Hat geklappt... Danke :D ... Dann bis zum nächsten mal :beer:
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 12.05.06 22:24 
Mach dir das Leben leichter (auch für die Zukunft) und schau dir mal die Eigenschaft "Anchors" an. Wenn man da Top und Left auf False stellt, und dafür Bottom und Right auf True, dann geht sowas automatisch ;-)

_________________
We are, we were and will not be.