Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Form2.Position := poScreenCenter; im onShow? (https://www.delphipraxis.net/16250-form2-position-%3D-poscreencenter%3B-im-onshow.html)

Pseudemys Nelsoni 13. Feb 2004 15:48


Form2.Position := poScreenCenter; im onShow?
 
hoi,

wieso funktioniert das im onshow nicht? ich möchte das wenn form 2 neu aufgerufen wird es wieder in der mitte des bildschirmes ist

Devil-Shark 13. Feb 2004 16:16

Re: Form2.Position := poScreenCenter; im onShow?
 
Hey das will ich auch!!!

Matze 13. Feb 2004 16:20

Re: Form2.Position := poScreenCenter; im onShow?
 
Delphi-Quellcode:
procedure TForm2.FormActivate(Sender: TObject);
begin
  Left := (Screen.Width - Width) div 2;
  Top := (Screen.Height - Height) div 2;
end;

Pseudemys Nelsoni 13. Feb 2004 18:53

Re: Form2.Position := poScreenCenter; im onShow?
 
danke das geht :mrgreen:

aber wieso geht das mit position nicht?

Neg 13. Feb 2004 21:36

Re: Form2.Position := poScreenCenter; im onShow?
 
Das liegt wohl daran, dass die Position nur einmal festgelegt wird, nämlich, wenn das Formular erstellt wird. Dort wird das Fenster entsprechend des Attributs "Position" ausgerichtet. Ab dann spielt nur noch die aktuelle Position, die vom Anwender eben auch verändert werden kann, eine Rolle, egal, ob man das Fenster zwischendurch schließt usw.


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

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