Autor Beitrag
Radioactive
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 04.06.05 12:29 
Hi Leute,
sagt mal, wie kann ich ein Fenster in Delphi .net modal oder normal öffenen? Und wie kann ich auf Komponenten dieses Fesnters zugreifen? Oder geht das nicht?
Danke!


Moderiert von user profile iconChristian S.: Topic aus .NET verschoben am Sa 17.09.2005 um 22:26

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 04.06.05 13:23 
Wenn du sowas wie ShowModal() aus Delphi meinst, das heißt unter .NET ShowDialog()...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Marauder
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 72



BeitragVerfasst: Mi 08.06.05 00:43 
An sowas ähnlichem arbeite ich auch gerade...

du rufst es auf :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
 frmSprachen := TSprachen.Create  ;
 frmSprachen.TopLevel := false;
 frmSprachen.Visible := True;
 frmSprachen.BringToFront ;


(frmSprachen ist ein Formular namens TSprachen)

ich persönlich habe noch einen Verweis auf TSprachen als glActiveForm (Im Create)

Jetzt kann ich aus dem Hauptform glActiveForm überall ansprechen mit :

ausblenden Delphi-Quelltext
1:
(glActiveForm as TSprachen).test('Das ist ein toller Test');					


Test ist eine Procedure mit einem Parameter : String, wird nur ne Messagebox ausgegeben.

Ansonsten kannst du auch das Form mit Create erzeugen und dann direkt dort ansprechen :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 frmSprachen := TSprachen.Create  ;
 frmSprachen.TopLevel := false;
 frmSprachen.Visible := True;
 frmSprachen.BringToFront ;
 frmSprachen.Test('Test');



Modal / Nicht Modal :

Nicht Modal
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
with Sprachen.TSprachen.create do begin
     Owner := self;
     Show;
     StartPosition := formstartposition.CenterScreen ;
end;


Modal
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
with Sprachen.TSprachen.create do begin
     Owner := self;
     ShowDialog;
     StartPosition := formstartposition.CenterScreen ;
end;


Mein Problem ist : Ich habe mehrere Forms in denen ich immer die selben Funktionen habe, z.b.: Neu.
Wie kann ich die Dinger mit Late Binding ansprechen ?
Hm... für Deine Zwecke sollte es so genügen, ich mach mal wieder nen neuen Thread für mich auf... :wink:
Radioactive Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 179

Win 98, Win XP Home SP2
D3 Prof, D7 Pers, D2005 Pers
BeitragVerfasst: Do 09.06.05 18:21 
ok, danke, werde es dann mal ausprobieren...

_________________
Radioactive
"Wer scrollt, verliert!" Matthias Stein, Informatiklehrer am GG
Marauder
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 72



BeitragVerfasst: Do 09.06.05 19:17 
Wobei ich gerade bemerke...

ausblenden Delphi-Quelltext
1:
2:
 ShowDialog;  
 StartPosition := formstartposition.CenterScreen ;


Das muss natürlich so rum sein...

ausblenden Delphi-Quelltext
1:
2:
 StartPosition := formstartposition.CenterScreen ;  
 ShowDialog;


sonst macht das keinen Sinn... :wink: