Autor Beitrag
BasicMan33
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54

Win 95, Win XP
D7
BeitragVerfasst: Di 23.08.05 16:33 
Hallo,

Im groben sagt es der Titel schon. Ich rufe ein zweites Formular aus dem ersten heraus auf mit FORM2.ShowModal.
In diesem neu aufgerufenen Formular möchte ich Eigenschaften des 1. Formulars z.B. Caption oder anderes ändern.
Zwar könnte ich das mit FORM1.Caption machen, aber nehmen wir mal an, es steht nicht fest, dass das Ausgangsformular immer FORM1 ist.
Wie finde ich den Componentenname meines Formulars zur Laufzeit heraus? :?:
rochus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416

Win XP Prof, Fedora Core 4, SuSE 7.0
D7 Ent, D2005 Pers
BeitragVerfasst: Di 23.08.05 16:52 
Screen.Forms?

_________________
Im Nachhinein ist man immer ein Schlauch!
"Dream as if you'll live forever, live as if you'll die today!" James Dean
BasicMan33 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54

Win 95, Win XP
D7
BeitragVerfasst: Di 23.08.05 20:00 
Also ich hab mir die Sache mal angeschaut und finde, dass es schon in die richtige Richtung geht. Damit würde ich mich auch schon zufrieden geben.
Jetzt wollt ich aus sicherheitsgründen nochmal nachfragen, ob das aktuelle Formular IMMER
den Index 0 hat und das Formular davor den Index 1, oder ob sich das gerade bei mir zufällig
so ergeben hat.
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: Di 23.08.05 22:24 
Es geht auch über "FindWindow"
firus1983
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 170

Win98,XP,
D6 Entrpr
BeitragVerfasst: Mi 24.08.05 09:19 
Fragt man die Delphi-Hilfe zum Thema Screen.Forms sagt sie folgendes (inkl. Reihenfolge)

Zitat:

Die Eigenschaft Forms führt alle Formulare auf, die aktuell in der Anwendung angezeigt werden.

property Forms[Index: Integer]: TForm;

Beschreibung

Mit Forms können Sie auf ein Formular über seinen Index zugreifen. Der Wert von Index ist eine Zahl zwischen 0 (das erste Formular) und FormCount - 1. Die Eigenschaft Forms kann zusammen mit FormCount eingesetzt werden, um eine Iteration über alle Formulare und Dialogfelder einer Anwendung durchzuführen.

Warnung: Die Reihenfolge, in der Forms die Formulare aufführt, ist von der Z-Reihenfolge der Formulare abhängig. Ändern Sie die Z-Reihenfolge nicht, wenn Sie mittels Forms iterativ auf die Formulare in der Anwendung zugreifen.

_________________
Veni Vidi Codi !
Ich kam, sah, und programmierte !