FormA-->FormB-->FormC 有沒有辦法從FormC中得知Create它的是FormB |
答題得分者是:l630521
|
egg_huang
一般會員 發表:4 回覆:5 積分:1 註冊:2003-05-23 發送簡訊給我 |
|
huangeider
高階會員 發表:288 回覆:492 積分:231 註冊:2003-02-26 發送簡訊給我 |
設個全域變數看看
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
teststring:string;
end; var
Form1: TForm1; implementation uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
begin
try
form2:=tform2.Create(application);
teststring:='i am created by form1';
form2.Show;
showmessage(teststring);
finally
teststring:='';
end;
end; 堅持從洗馬桶做起
Eric
|
egg_huang
一般會員 發表:4 回覆:5 積分:1 註冊:2003-05-23 發送簡訊給我 |
感謝大大回應!!
我不是要從 Form1得知,我是要在 Form2 內得知 Create 它的是 Form1
引言: 設個全域變數看看 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } teststring:string; end; var Form1: TForm1; implementation uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin try form2:=tform2.Create(application); teststring:='i am created by form1'; form2.Show; showmessage(teststring); finally teststring:=''; end; end; 堅持從洗馬桶做起 Eric |
l630521
資深會員 發表:15 回覆:349 積分:372 註冊:2003-02-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |