K kowity Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-10 #1 比如:我在窗体一上有个文字框,在窗体二上有个文字框和一个按钮。怎样才能做到在窗体二中输入字符,按确定后弹出窗体一,并在窗体一的文字框里显示刚才在窗体二的文字框里输入的内容呢? 代码:
卷 卷起千堆雪tyn Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-10 #2 var Form1: TForm1; implementation uses Unit2; {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); begin Form2.Show; end; ******************************************************* implementation uses Unit1; {$R *.DFM} procedure TForm2.Button1Click(Sender: TObject); var S :String; begin S :=Edit1.Text; Form1.Edit1.Text :=S; Close; end;
var Form1: TForm1; implementation uses Unit2; {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); begin Form2.Show; end; ******************************************************* implementation uses Unit1; {$R *.DFM} procedure TForm2.Button1Click(Sender: TObject); var S :String; begin S :=Edit1.Text; Form1.Edit1.Text :=S; Close; end;
V varphone Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-10 #3 begin if From1 <> nil then Form1.Edit1.Text := self.Edit1.Text; close; end;
S SINGLBOY Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-10 #4 implementation uses Unit1;
P peter_peng1980 Unregistered / Unconfirmed GUEST, unregistred user! 2001-11-10 #5 var Form2: TForm2; implementation uses Unit1; {$R *.DFM} procedure TForm2.Button1Click(Sender: TObject); begin form1:=TForm1.Create(nil); form1.Edit1.Text:=Edit1.Text; form1.ShowModal; form2.Free; end;
var Form2: TForm2; implementation uses Unit1; {$R *.DFM} procedure TForm2.Button1Click(Sender: TObject); begin form1:=TForm1.Create(nil); form1.Edit1.Text:=Edit1.Text; form1.ShowModal; form2.Free; end;