Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Positionieren des Formulars funktioniert nicht! (https://www.delphipraxis.net/56991-positionieren-des-formulars-funktioniert-nicht.html)

Cyberbob 14. Nov 2005 18:37


Positionieren des Formulars funktioniert nicht!
 
Ich Versuche seit Tagen verzweifelt, das Formular meines Programmes in die Mitte des Desktops zu verschieben. Hierfür benutze ich:

Delphi-Quellcode:
frmEnigma.Top := (Screen.Height - frmEnigma.Height) div 2;
frmEnigma.Left := (Screen.Width - frmEnigma.Width) div 2;
Unter Delphi6 Personal Funktioniert das Einwandfrei. Unter Delphi2005 Personal jedoch sitzt das Formular immer in der Linken oberen Ecke. Was mach ich falsch?

BenjaminH 14. Nov 2005 18:41

Re: Positionieren des Formulars funktioniert nicht!
 
Hallo
Schau dir doch mal TForm.Position an, damit müsste das auf jeden Fall gehen.

Tschüssi

Garfield 14. Nov 2005 21:07

Re: Positionieren des Formulars funktioniert nicht!
 
Kommt drauf an, wo Du den Code zu stehen hast. Im OnCreate des Forms schreibt man
Delphi-Quellcode:
Top := (Screen.Height - Height) div 2;
Left := (Screen.Width - Width) div 2;
Funktioniert natürlich nur, wenn frmEnigma.Position auf poDesigned steht.


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:00 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz