S
super12345
Unregistered / Unconfirmed
GUEST, unregistred user!
主窗体mainform是一个fsMDIForm调用一个fsMDIChildForm的子窗体form1
在这个子窗体调用一个fsNormal的窗体form2
在mainform中用以下语句调用form1
if not Assignedform1) then
Application.CreateForm(Tform1, form1);
form1.Show;
窗体form1:
我在form1中设置一个DBEdit1和Btn1的控件
implementation
uses form2;
btn1的执行语句
if form2 = nil then
Application.CreateForm(Tform2,form2);
form2.Show;
在窗体form2中放置一个Btn1和一个Edit1的控件
implementation
uses form1;
Btn1的语句是
Edit1.Text:=form1.DbEdit1.Text;
运行到Showmessage(form1.edit1.text)时出现以下错误
Access violation at address 005FB3C7 in module 'Soft.exe'.
Read of address 00000360.
但如果我在form1的Btn改成如下就不会出错。
Application.CreateForm(TForm2, Form2);
if Form2.ShowModal = mrok then
begin
DbEdit1.Text:=Form2.Edit1.Text;
end;
这是为什么?由于程序的需要就是要用第一种方法,哪位高手指点,分不够再给啊。
在这个子窗体调用一个fsNormal的窗体form2
在mainform中用以下语句调用form1
if not Assignedform1) then
Application.CreateForm(Tform1, form1);
form1.Show;
窗体form1:
我在form1中设置一个DBEdit1和Btn1的控件
implementation
uses form2;
btn1的执行语句
if form2 = nil then
Application.CreateForm(Tform2,form2);
form2.Show;
在窗体form2中放置一个Btn1和一个Edit1的控件
implementation
uses form1;
Btn1的语句是
Edit1.Text:=form1.DbEdit1.Text;
运行到Showmessage(form1.edit1.text)时出现以下错误
Access violation at address 005FB3C7 in module 'Soft.exe'.
Read of address 00000360.
但如果我在form1的Btn改成如下就不会出错。
Application.CreateForm(TForm2, Form2);
if Form2.ShowModal = mrok then
begin
DbEdit1.Text:=Form2.Edit1.Text;
end;
这是为什么?由于程序的需要就是要用第一种方法,哪位高手指点,分不够再给啊。