Autor Beitrag
BigBossMan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 12.08.04 18:31 
Hallo Leute !

Wie kann ich auf mehrere dyn. erstellte Formen zugreifen ?
Und wenn, wie geht das ?


Vielen Dank im voraus.

Mfg
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 12.08.04 19:03 
Die Formulare haben's dir ja angetan! Du müsstest die Variable des Objects irgendwo speichern, wo du immer darauf zugreifen kannst. Z.b. ein globales Array, oda so.

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
BigBossMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 12.08.04 19:07 
maxk hat folgendes geschrieben:
Die Formulare haben's dir ja angetan! Du müsstest die Variable des Objects irgendwo speichern, wo du immer darauf zugreifen kannst. Z.b. ein globales Array, oda so.


Ich habe noch eine dämmliche Frage: Und Wie ???
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 12.08.04 19:11 
dämmliche Fragen gibt's nicht!
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
{...}
var Form1:TForm1;
    DynForms:array of TForms; // WICHTIG
{...}
procedure CreateForm;
var AForm:TForm;
begin
 AForm:=TForm.Create;
 {...}
 SetLength(DynForms,Length(DynForms)+1);
 DynForms[length(DynForms)-1] :=AForm;
end;
{...}
procedure SetCaption(Old,New:string);
var i:integer;
begin
 for i:=0 to length(DynForms)-1 do if AnsiSameText(DynForms[i].Caption,Old) then DynForms[i].Caption:=New;
end;

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
BigBossMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 12.08.04 19:15 
maxk hat folgendes geschrieben:
dämmliche Fragen gibt's nicht!
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
{...}
var Form1:TForm1;
    DynForms:array of TForms; // WICHTIG
{...}
procedure CreateForm;
var AForm:TForm;
begin
 AForm:=TForm.Create;
 {...}
 SetLength(DynForms,Length(DynForms)+1);
 DynForms[length(DynForms)-1] :=AForm;
end;
{...}
procedure SetCaption(Old,New:string);
var i:integer;
begin
 for i:=0 to length(DynForms)-1 do if AnsiSameText(DynForms[i].Caption,Old) then DynForms[i].Caption:=New;
end;


Danke erstmal, werde es ausprobieren.

Mfg