Autor Beitrag
Distelpalme
Hält's aus hier
Beiträge: 8

Win 2k; Lnx Kubuntu; Mac osX
Delphi 4;Qbasic <-lol
BeitragVerfasst: So 12.12.04 12:04 
Hallöle :D
Ich hätt ne frage, und zwar, wenn ich in delphi ein 2. unit und ein 2. formular erstelle, wie kann ich das aus dem ersten aufrufen?
z.B.:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button5Click(Sender: TObject);
begin
     //anweisung um TForm2 zu starten...
end;


thx :D

_________________
Dan*
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: So 12.12.04 12:39 
Eine von ungefähr hundertdreiundsiebzig Möglichkeiten:

ausblenden Delphi-Quelltext
1:
TForm2.Create(Application).Show;					

oder:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
MeineFormVariable: TForm2;
[...]
MeineFormVariable := TForm2.Create(Application);
MeineFormVariable.Show;

...und immer an die Freigabe denken!
matze.de
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 576

Win95, Win98 SE, WinXp Prof SP2
D7P, D8P, FPC2.0
BeitragVerfasst: So 12.12.04 12:42 
du kannst auch auf Datei->Unit benutzen gehen dann Unit2 auswählen und bestätigen.
dann schreibste in deine prozedur:
ausblenden Delphi-Quelltext
1:
Form2.Show;					


mfg matze

_________________
si tacuisses, philosophus mansisses.
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: So 12.12.04 18:23 
matze.de hat folgendes geschrieben:
du kannst auch auf Datei->Unit benutzen gehen dann Unit2 auswählen und bestätigen.
dann schreibste in deine prozedur:
ausblenden Delphi-Quelltext
1:
Form2.Show;					

...was aber nur fehlerfrei möglich ist, wenn Form2 automatisch erzeugt wird.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 12.12.04 18:37 
Wie er schon gesagt hat, hat er bereits ein 2. Formular erstellt =>
ausblenden Delphi-Quelltext
1:
Form2.show					

klappt. Beim ersten mal wird er zwar gefragt, ober Unit2 in die uses liste hinzufügen will, aber nach einem klick auf "ja" und neuem Compilieren geht doch alles... warum kompliziert...? :D

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: So 12.12.04 21:09 
JayEff hat folgendes geschrieben:
Wie er schon gesagt hat, hat er bereits ein 2. Formular erstellt =>
ausblenden Delphi-Quelltext
1:
Form2.show					

klappt. Beim ersten mal wird er zwar gefragt, ober Unit2 in die uses liste hinzufügen will, aber nach einem klick auf "ja" und neuem Compilieren geht doch alles... warum kompliziert...? :D

Was ist, wenn Du eine von Form2 unabhängige zweite Instanz von TForm2 haben willst, z.B.?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 12.12.04 22:26 
daran hatte ich nicht gedacht :oops: aber hey: ich bin auch nur n mensch :wink:

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: So 12.12.04 22:29 
Ich hab bissher immer Form2.Visible := true; genommen. :lol:
Robert.Wachtel
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 895
Erhaltene Danke: 7

Windows 7 Ultimate x64
D5 Ent, D7 Arch, RAD Studio 2010 Pro, VS 2008
BeitragVerfasst: So 12.12.04 23:29 
Coder hat folgendes geschrieben:
Ich hab bissher immer Form2.Visible := true; genommen. :lol:

Was - bis auf das fehlende BringToFront - auch nichts anderes als ein Form2.Show ist...