Autor Beitrag
JoBoCAD
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mo 05.03.12 11:50 
Hallo Zusammen,

wie kann ich es programmtechnisch abfangen
dass ein Form während der Programmausführung nur einmal geladen/initialisiert wird:

Beispiel:
Application.CreateForm(TDB1,DB1);

Dabei gilt es zu vermeiden bereits zu Programmstart alle Forms zu initialisieren.

Vielen Dank
Joachim
bummi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1248
Erhaltene Danke: 187

XP - Server 2008R2
D2 - Delphi XE
BeitragVerfasst: Mo 05.03.12 11:53 
Projekt/Optionen/Formulare/Automatisch erzeugen > verschieben nach Verfügbare Formulare
oder im Projekt die betreffende Zeile löschen

meinst Du das?

_________________
Das Problem liegt üblicherweise zwischen den Ohren H₂♂
DRY DRY KISS

Für diesen Beitrag haben gedankt: JoBoCAD
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8553
Erhaltene Danke: 479

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 05.03.12 11:56 
Wenn die betreffende Form nicht in der Liste der automatisch erzeugten Formen auftaucht, kann man das so lösen:

ausblenden Delphi-Quelltext
1:
2:
3:
if not assigned(MeineZweiteForm) then  // Diese Abfrage überall, wo die Nebenform benötigt wird
    Application.CreateForm(TMeineZweiteForm, MeineZweiteForm);
MeineZweiteForm.Show;


MeineZweiteForm ist dabei die globale Variable, die in der entsprechenden Unit automatisch deklariert wird.

_________________
We are, we were and will not be.

Für diesen Beitrag haben gedankt: DonManfred, JoBoCAD