地 地球 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #1 如何使一个MDIChild窗口点开另一个MDIChild窗口,然后再点击后面窗口的button,使后面窗口的 edit里的 属性传递给第一个窗口
D delphiland Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #3 在第一个窗口中定义一个Public变量AAA, USE 第一个窗口单元 然后后面窗口的buttonclick事件中: 第一个窗口.AAA:=edit.text;
L laohe Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #4 form1.edit1.text:=form2.edit1.text;
S sunrainwang Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #6 如何使一个MDIChild1窗口点开另一个MDIChild2窗口,然后再点击后面窗口(MDIChild1?MDIChild2?) 的button(手动?代码驱动),使后面窗口的 edit里的属性传递给第一个窗口
如何使一个MDIChild1窗口点开另一个MDIChild2窗口,然后再点击后面窗口(MDIChild1?MDIChild2?) 的button(手动?代码驱动),使后面窗口的 edit里的属性传递给第一个窗口
地 地球 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #7 如何使一个MDIChild1窗口点开另一个MDIChild2窗口,然后再点击后面MDIChild2的button使MDIChild2窗口的 edit里的属性传递给MDIChild1窗口
D delphiland Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #8 在Project Option中将Form3从AutoCreate中移走 //=============================================== unit Unit2; uses Unit3; procedure TForm2.Button1Click(Sender: TObject); begin Form3:=TForm3.Create(Self); Form3.Show; end; ================================================= unit Unit3; uses Unit2; procedure TForm3.Button1Click(Sender: TObject); begin Form2.Button1.Caption:=Edit1.Text; end;
在Project Option中将Form3从AutoCreate中移走 //=============================================== unit Unit2; uses Unit3; procedure TForm2.Button1Click(Sender: TObject); begin Form3:=TForm3.Create(Self); Form3.Show; end; ================================================= unit Unit3; uses Unit2; procedure TForm3.Button1Click(Sender: TObject); begin Form2.Button1.Caption:=Edit1.Text; end;
L lovered Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-20 #10 //*******绝对100%正确 unit MDIChild; interface type TMDIChildForm=class(TForm) Edit1: TEdit; btnOpen: TButton; btnAssignEdit: TButton; public FrontFrom: TMDIChildForm;//任意窗体类 procedure btnOpenClick(Sender: TObject); procedure btnAssignEditClick(Sender: TObject); end; implementation { TMDIChildForm } procedure TMDIChildForm.btnAssignEditClick(Sender: TObject); begin with TfrmChild.Create(Self) do FrontForm := Self; end; procedure TMDIChildForm.btnOpenClick(Sender: TObject); begin if Assigned(FrontForm) then FrontForm.Edit1.Text := Edit1.Text; end; end.
//*******绝对100%正确 unit MDIChild; interface type TMDIChildForm=class(TForm) Edit1: TEdit; btnOpen: TButton; btnAssignEdit: TButton; public FrontFrom: TMDIChildForm;//任意窗体类 procedure btnOpenClick(Sender: TObject); procedure btnAssignEditClick(Sender: TObject); end; implementation { TMDIChildForm } procedure TMDIChildForm.btnAssignEditClick(Sender: TObject); begin with TfrmChild.Create(Self) do FrontForm := Self; end; procedure TMDIChildForm.btnOpenClick(Sender: TObject); begin if Assigned(FrontForm) then FrontForm.Edit1.Text := Edit1.Text; end; end.