![]() |
Wurde Form kreiert
Hi,
ich würde in meinem Delphi Programm gerne überprüfen ob ein Form schon existiert/kreiert wurde. Wie kann ich das anstellen? MfG |
Re: Wurde Form kreiert
mit :
If Assign(Form1) Then ... Wobei Form1 natürlich mit mit der Variable Deines Formulars zu ersetzen wäre ;-) |
Re: Wurde Form kreiert
ich habe das mal eingefügt
jedoch bekomme ich einen error:
Delphi-Quellcode:
[Error] Login.pas(63): Incompatible types: 'TPersistent' and 'Class reference'
if Assign(TClientForm) then begin
Connect(Server.Text,StrToInt(Port.Text)); end else begin with TClientForm.Create(Self) do begin ClientName := Username.Text; Connect(Server.Text,StrToInt(Port.Text)); Show; end end |
Re: Wurde Form kreiert
Weil Du auf einen Typen testest in Deinem Code und nicht auf eine Variable :p
Böser Code : Zitat:
Zitat:
Zitat:
LG, MRN |
Re: Wurde Form kreiert
sorry dass ich nochmals nachfrage aber
es funktioniert immer noch nicht. jetzt bekomme ich den fehler "Type of expression must be BOOLEAN". irgendwie fehlt mir noch das verständnis für die ganze sache.
Delphi-Quellcode:
if Assign(ClientForm) then begin
Connect(Server.Text,StrToInt(Port.Text)); end |
Re: Wurde Form kreiert
muß heißen If Assigned(ClientForm)...
Assign gibt es ja in Deinem Kontext auch, ist allerdings keine Boolsche Funktion ;-) |
Re: Wurde Form kreiert
Zitat:
|
Re: Wurde Form kreiert
ouu.. :wall:
jetzt hats geklappt thx!! |
Re: Wurde Form kreiert
kp
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:58 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