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/)
-   -   Prism Problem mit Location + DesktopLocation (https://www.delphipraxis.net/61896-problem-mit-location-desktoplocation.html)

gfjs 27. Jan 2006 17:11


Problem mit Location + DesktopLocation
 
Hallo, Allerseits.

Mein Formular macht nicht, was ich will! Es soll den gesamten Bildschirm oberhalb der Taskleiste ausfüllen.

Mein Quelltext:

Delphi-Quellcode:
procedure TWinForm.InitializeComponent;
begin
  //
  // TWinForm
  //
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 15);
  Self.ClientSize := System.Drawing.Size.Create(936, 608);
  Self.Name := 'TWinForm';
  Self.Text := 'WinForm';
  Self.Width := System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
  Self.Height := System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height-36;
  Self.DesktopLocation := System.Drawing.Point.Create(0,0);
end;
Width und Height funktionieren, DesktopLocation bzw. Location leider nicht. Das Fenster sitzt nicht ganz oben, sondern unterhalb der Kopfleiste. Auch wenn ich z.B. Point.Create(100,100) eingebe, bewegt es sich nicht von der Stelle. Woran könnte es liegen?

mfg gfjs

Habe gerade folgendes festgestellt:

Wenn ich StartPosition auf "Manual" setze, ist das Fenster zwar wie gewünscht ganz links oben bei (0,0) aber beim Start mit F9 werden meine Quelltextzeilen

Self.Width := System.Windows.Forms.Screen.PrimaryScreen.Bounds.W idth;
Self.Height := System.Windows.Forms.Screen.PrimaryScreen.Bounds.H eight-36;
Self.DesktopLocation := System.Drawing.Point.Create(0,0);

gelöscht und das Fenster hat die Größe, auf die ich es in der IDE gezogen habe.

gfjs 31. Jan 2006 03:31

Re: Problem mit Location + DesktopLocation
 
Nach langem Suchen bin ich jetzt selber draufgekommen:

Das Verschwinden meines Quellcodes hängt wohl damit zusammen, dass ich das Ganze nicht in TWinForm.Create sondern in TWinForm.InitializeComponent geschrieben hatte.

Und: Um das Formular wie gewünscht positionieren zu können muss StartPosition auf "Manual" gesetzt werden:

Delphi-Quellcode:
self.StartPosition := FormStartPosition.Manual;
self.Location := System.Drawing.Point.Create(0,0);
Vielleicht hlft's ja jemand?!

mfg gfjs


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:54 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