Autor Beitrag
k.kuh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
Delphi 6
BeitragVerfasst: Sa 03.02.07 19:49 
Hallo, alle zusammen!

Ich moechte testen, ob FormX schon erzeugt wurde, kann doch eigentlich nicht die welt sein, oder? sehr frustrierend, dass ich da nicht selbst drauf komme....
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 03.02.07 20:01 
Erzeugt bzw. created werden alle Forms schon beim Programmstart.
Ändern kannst du dann nur noch Show bzw Visible um sie anzuzeigen.
Beschreib dein Problem mal genauer.

MfG
k.kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
Delphi 6
BeitragVerfasst: Sa 03.02.07 20:06 
sorry, ich habe mich unklar ausgedrueck, ich habe eine procedure, die Popupform:=TForm.Create(self); ausfuehrt. ich koennte nun natuerlich durch eine globale variable die ich nach dem ausfuehren auf true setze erkennen, ob die procedure schon ausgefuehrt wurde, das empfand ich aber als etwas unelegant. gibt es nun die moeglichkeit festzustellen, ob popupform schon erstellt wurde?
if popupform.visible verursacht natuerlich einen fehler, wenn die from noch nicht erstellt wurde.....
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 03.02.07 20:08 
ausblenden Delphi-Quelltext
1:
If Assigned(Popupform) then...					

Mit Assigned kannst du prüfen, ob bereits Speicher für dein Objekt reserviert wurde oder nicht ;-)
D.h. prüfen ob Popupform = NIL.

grüße marc


Zuletzt bearbeitet von Marc. am Sa 03.02.07 20:09, insgesamt 1-mal bearbeitet
DarkLord05
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 449

WinXP Pro SP2
Opera; Delphi 3 Pro; Delphi 2005, Turbo Delphi, dev-c++, Eclipse, MS Visual Studio .NET 2003, MS Visual C++
BeitragVerfasst: Sa 03.02.07 20:08 
// EDIT

Marc hats gesagt, so ist es ^^

_________________
QBasic | Delphi | c++ | PHP | C# .NET | Java
k.kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
Delphi 6
BeitragVerfasst: Sa 03.02.07 20:13 
herzlichsten dank, ich wusste, dass ich mich auf euch verlannen kann! :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Sa 03.02.07 20:16 
user profile iconCoder hat folgendes geschrieben:
Erzeugt bzw. created werden alle Forms schon beim Programmstart...


Da gibts wirklich nützliche Delphi-Foren und ihr könnt immer noch kein Delphi ? :mrgreen: Gucke besser mal bei Project-Options. Und da bei "aus dem Projekt entfernen". Trotz 200 Forms sehe ich da nur 5 Units. Warum ? Weil sie so erzeugt werden :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure Tfrm.lblClick(Sender: TObject);
begin
  inherited;
showmessage (BoolToStr (frm2 <> NIL,true));
  frm2 := Tfrm2.Create(Self);
  frm2.Show;
showmessage (BoolToStr (frm2 <> NIL,true));
end;


Und was zeigen nun die showmessage ?? Die erste zeigt false, die zweite true. Dürfte hoffentlich fast klar sein, was gemacht werden muss.

_________________
Gruß
Hansa