Autor Beitrag
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Sa 11.12.04 20:45 
Hi,
ich habe ein Formblatt Dynamisch erzeugt. Das Formblatt hat einen Namen. Dieser Name steht in einem Editfeld, daraus wurde der Name des Formblattes auch ausgelesen.

Nun habe ich das Dynamisch erstellte Formblatt angezeigt. Auf dem Formblatt sind weitere Dynamisch erstellte Kompos.

Nun klickt ein Benutzer auf das X des D.Formblattes. Wie kann ich dieses Formblatt wieder anzeigen?

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Sa 11.12.04 20:51 
Wenn der Name des Formblattes z.B. FormBlattX ist, genügt:
ausblenden Delphi-Quelltext
1:
FormBlattX.Show;					

Falls du das Formblatt aber beim Schließen frei gibts, musst du es komplett neu erzeugen.
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Sa 11.12.04 22:19 
OK.
Nun ist der Name des Formblatts aber auch Dynamisch. Der Name des Formblatts ist in einer Var gespeichert. Wie kann ich dann das Formblatt wieder aufrufen ??

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 11.12.04 22:51 
Wenn du das Formblatt mit Eigentümer Application erzeugst, reicht ein simples Application.FindComponent aus, danach ein Typecast und du kannst ganz normal zugreifen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Sa 11.12.04 23:16 
ok. wie sieht dann ein Konkrete4s Beispiel aus, die OH hat mir nichts aufschlussreiches gebracht.
application.FindComponent(form).show; geht leider nicht.

Und wie das mit ner If Abfage funzt hab ich leider auch nicht gefunden.

Geht das nicht irgendwie so:

ausblenden Delphi-Quelltext
1:
2:
3:
var MeinFormName:string;
{...}
MeinFormName.show;


thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
Pr0g
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Sa 11.12.04 23:42 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var
  FormName: String;

FormName := 'MeineForm';
(Application.FindComponent(FormName) as TForm).Show;


MfG Pr0g
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: So 12.12.04 00:36 
wunderbar... :D

vielen Dank !!

hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej