需要被更改的信息做成全局的。或者是form1的public,只要unit2引用unit1就可以共享。
不知是否明白?
不知是否明白?
解决方案 »
- 棘手的问题,估算一个任务的时间,高手来看看
- 怎样使用TimeStamp的字段类型?
- 请问:delphi自带的数据库最大容量是多少?急!急!!!!谢谢!!!!!!!!!!!!
- 在FastReport中用什么语句代替QuickReport中的xxxx.PreviewModal的显示报表命令。
- 关于comport 控件的使用
- 请教高手,关于combobox的使用
- 直接在Dbgrideh修改了数据后自动提交如何做,求指教~
- 我怎么可以控制speedbutton的按钮状态???
- 特急:请问关于数据库的问题!
- 我是个初学者,请问多看一些实例的书是不是入门更快,或者说比其它书更好学
- 散分、十万火急:谁成功地实现过:pb和delphi互相调用对方做的COM/MTS server
- windowsXP Professional下为何无法安装SQL Server2000
不知是否明白?
在被调用页面改变其值。
如:
调用窗体
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
st:string;
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
begin
form2.Showmodal;
end;end.;
被调用窗体
unit Unit2;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementationuses Unit1;{$R *.DFM}procedure TForm2.Button1Click(Sender: TObject);
begin
form1.st:='ok';
end;end.
就是想弄一个输入信息的窗口
formInformation.borderstyle := bsDialog;
其中有一个edit用于输入...
主窗口中调用代码:formInformation := TformInformation.create(self);
formInformation.showmodal;
这里开始弹出窗口,输入信息
....
该窗口关闭后回到主窗口:variables1 := formInformation.edit1.text;
//这里释放信息窗口
formInformation.free;
formInformation := nil;
var
InputString: string;begin
inputString:= InputBox('输入框', '输入', '默认值');
showmessage(inputstring);
end;end.
然后在Form1中通过Form2.a调用!