unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
//这里定义
temp:String;implementation{$R *.dfm}end.
在form2的implementation下面写上uses unit1
就没有问题了呀,
注意,不要在定义temp的非全局变量了。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
//这里定义
temp:String;implementation{$R *.dfm}end.
在form2的implementation下面写上uses unit1
就没有问题了呀,
注意,不要在定义temp的非全局变量了。
解决方案 »
- 在Object Inspector 中看到ADOTable 组件的Connection属性。而ADOTable组件源代码里为什么没有写?
- 如何在StringGrid中间的其中一个格子加个小图标
- listview 加入colorbox
- Delphi编译出来的Exe程序是机器代码吗?
- 怎么样才能把一个FORM上的所有COMPONENT都写到一个文件中,然后再读出来显示在FORM上呢?
- 错误提示:Floating point division by zero
- 高分请教高难问题,解决者将是恩人。
- 我用ado访问数据库,出错·!!!
- 请教delphi中调用存储过程的问题!
- 如何将连接ORACLE的BDE封装在安装程序中??
- 怎样从数据库中读取Image类型的数据??
- ClientDataSet1的Params不支持中文如何解决,急!!!
form1.temp 就可以了
i:integer;然后在form2的impelment 下面uses form1.然后在form2放一个buttom
在button的click里调用 form1.i:=5;
i:integer;然后在form2中use form1可以引用了
var
Form1: TForm1;
//这里定义
temp:String;
那么走form2中就应该用temp,不是form1.temp;
如果是在public中定义,就应该用form1.temp;
我已经给分了,
全局變量傳值.
方法(2)
edit等控件傳值,設visible:=False .