Autor Beitrag
pk910
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: So 27.08.06 21:28 
Hallo...

Ich programmiere gerade etwas, wofür ich ein Abfrage formular brauche...
Im Abfrage formular (form2) wird Username und Passwort abgefragt.
Wenn ich auf ok klicke mussen die daten irgendwie auf form1 verfügbar sein.
Wie mache ich das?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 27.08.06 21:39 
Sind sie: man kann über Form2.<Edit>.Text darauf zugreifen.

_________________
Markus Kinzler.
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: So 27.08.06 21:39 
du bindest die Unit der form2 in der Uses-Klausel in die Unit von form1 ein.
dann kannste in der Unit von form1 auch auf eigenschaften der komponenten von form2 zugreifen.

z.B. user := form2.edit1.text; //in Unit1
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Mo 28.08.06 10:37 
aber wie mache ich das mit dem button click?
der button muss ja etwas auf form1 ausführen
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 28.08.06 10:42 
Wie wird Form2 aufgerufen?

_________________
Markus Kinzler.
Masterhawk
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 92

Win 2000,Win XP
D6 Pers
BeitragVerfasst: Mo 28.08.06 12:20 
Dann mach doch einfach

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
implementation
uses unit1; //musst du hier einbinden, wenn in Unit1 unter uses form2 schon eingebunden wird

[...]
procecdure TForm2.Button1Click(...);
begin
  form1.user:=edit1.text; //Usertextfeld
// oder
 form1.SetUserData(edit1.text,edit2.text);//Procedure in Unit1
end;
[...]
end.


In Unit1 müsste dann noch die Procedure eingefügt werden
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.SetUserData(txt_User,txt_Password:string);
begin
 user:=txt_User;
 pswd:=txt_Password;
end;



Ich hoffe, dass das weiterhilft.....BTW: COde ist ungetestet
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Mo 28.08.06 18:35 
danke