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 Form versteckt sich (https://www.delphipraxis.net/58165-form-versteckt-sich.html)

Rolf Rostig 2. Dez 2005 10:33


Form versteckt sich
 
Hallo,

ich habe eine Hauptform.
Von dort rufe ich mit ShowModal Form2 auf,
von dieser wieder mit ShowModal Form3.
Wenn ich die 3. Form schliesse, ist Form2 hinter Form1, das ist schlecht.
Nun wollte ich mit dem OnClose Ereignis

Delphi-Quellcode:
procedure TForm3.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Form2.BringToFront;
end;
Geht auch, aber wenn vorher die Form2 nicht geöffnet wurde, gibt es einen Fehler.
Wie kann ich das verhindern?

Bernhard Geyer 2. Dez 2005 10:49

Re: Form versteckt sich
 
Verwendest Du WindowsXP?

Falls ja - Dies ist ein Problem der VCL mit dem geänderten Windows-Handling von XP.
Dieses Problem wurde ab D2005 (oder wars D8) gelößt (weiß aber nicht mehr den Link wo das erklärt wurde).

RavenIV 2. Dez 2005 11:13

Re: Form versteckt sich
 
du musst vor
Delphi-Quellcode:
Form2.BringToFront;
prüfen, ob das Form2 auch angezeigt wird.
z.B. mit:
Delphi-Quellcode:
if Form2.Visible then

Rolf Rostig 2. Dez 2005 11:41

Re: Form versteckt sich
 
@RavenIV

Danke, das ist es. :xmas:


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