谢谢
解决方案 »
- IDHTTP+TOMCAT引起TOMCAT内存溢出!
- 关于TClientDataSet组件对服务器端进行数据库操作的问题!
- 怎么样动态创建ActionToolBar啊?请大侠指点!
- 急得不得了!!!这个问题对我来讲有点麻烦(关于dbgrid表)!
- RAVE如何链接query进行打印?
- VCL.NET敢问路在何方?
- 请教:有delphi中实现snmp mib管理的控件吗
- 如果响应Win2000在系统栏上弹出的右键菜单点击"最小化所有窗口"?
- 急!关于获取系统目录问题
- 我又遇到问题辣.头大呀.
- 怎样才能使c++builder和delphi6共存?
- 怎么在程序里动态给TTABLE,或Tclientdataset加入字段!
fm : TForm2;
begin
fm := Tform2.Create(nil);
if fm.ShowModal = mrOK then
begin
.....
end
else
begin
....
end;
end;
但这个数据是整型. 在 Form2 中直接对 ModalResult 赋值就可以关闭窗体了.
看这个//....省略
type
TForm2 = class(TForm)
private
//r作为一个中间的数值进行计算,计算结果经过返回参数返回调用位置
r: string;
public
end;
//从其他模块运行以下函数ShowForm2调用模块2
//参数说明:FHcs 返回参数;CRcs:传入参数
function ShowForm2(var FHcs: string;CRcs:string): Boolean;
var
Form2: TForm2;implementation{$R *.DFM}function ShowForm2(var FHcs: string;CRcs:string): Boolean;
begin
with TForm2.Create(Application) do
try
r:=CRcs;
Result := (ShowModal = mrOk);
finally
FHcs :=r;//返回处理完毕的中间值
Free;
end;
end;//确定按钮
procedure TForm2.Button1Click(Sender: TObject);
begin
ModalResult := MB_OK;
Close;
end;//中间过程,处理中间值r
procedure TForm2.Button2Click(Sender: TObject);
begin
r:=r+'红尘';
end;//form1中,调用ShowForm2
procedure TForm1.Button1Click(Sender: TObject);
var s:string;
begin
if ShowFormDY(s,Label1.Caption)=true then
Label1.Caption:=s;
end;在以上程序中,假设form1.label1.caption显示为"醉恋",那么在form1按下按钮button1以后,显示form2,在from2按下按钮button2,然后按下button1关闭form2以后,form1的label.caption就被更新为"醉恋红尘"。
我说的这麽详细不知道你看懂了没有?