需要被更改的信息做成全局的。或者是form1的public,只要unit2引用unit1就可以共享。
不知是否明白?

解决方案 »

  1.   

    需要被更改的信息做成全局的。或者是form1的public,只要unit2引用unit1就可以共享。
    不知是否明白?
      

  2.   

    unit2就是弹出的form2的单元文件。
      

  3.   

    在调用窗体的public下声明一公用变量:
    在被调用页面改变其值。
    如:
    调用窗体
    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.
      

  4.   

    form
    就是想弄一个输入信息的窗口
      

  5.   

    formInformation为用于输入信息的窗口
    formInformation.borderstyle := bsDialog;
    其中有一个edit用于输入...
    主窗口中调用代码:formInformation := TformInformation.create(self);
    formInformation.showmodal;
    这里开始弹出窗口,输入信息
    ....
    该窗口关闭后回到主窗口:variables1 := formInformation.edit1.text;
    //这里释放信息窗口
    formInformation.free;
    formInformation := nil;
      

  6.   

    showmodal 可以返回参数,使用showmodal试一下,可以查看DELPHI 的帮助
      

  7.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      InputString: string;begin
       inputString:= InputBox('输入框', '输入', '默认值');
       showmessage(inputstring);
    end;end.
      

  8.   

    最簡單的是樓上說的,其實你也可以自己做一個Form,通常我們在做程序的時候,都會有個密碼驗證的Form,與你這個有點類似.這個不難,ShowModal應該可以實現你講的功能,你可能是個初學者,慢慢學吧
      

  9.   

    Form2的public中定义全局变量a,在Form1中的implementation下引用uses Unit2;
    然后在Form1中通过Form2.a调用!