今天刚用delphi,向各位请教下RT的问题。
就是我创建对话框的时候,如何同时也能传个值进去?
------------------------------------------
比如CB里面有个 
int Index(0);
TfrmTest *dlg = new TfrmTest(this,Index);
dlg->ShowModal();
然后在TfrmTest的构造函数中将Index的值拿过来用就行
-------------------------------------------
那么Delphi中怎么搞呢?谢谢大家了

解决方案 »

  1.   

    Self.Tag//临时保存值
    Form1 := TForm1.Create(self);//Self这里就是个参数啦!!嘿嘿。
    然后可以通过Self.Owner.Tag取值。方法多多。
      

  2.   

    var
      Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      Form2 := TForm2.Create(Application,100);
      Form2.ShowModal;
    end;type
      TForm2 = class(TForm)
      private
        { Private declarations }
      public
        constructor   create(AOwner:TComponent;index:Integer);reintroduce;
      end;var
      Form2: TForm2;implementation{$R *.dfm}{ TForm2 }constructor TForm2.create(AOwner: TComponent; index: Integer);
    begin
      inherited  Create(AOwner);
      ShowMessage(IntToStr(index));
    end;end.