能否利用screen.ActiveForm在窗体的变量(比如:自己设的integer,string,variant)得到呢?

解决方案 »

  1.   

    放在 public 下面的变量就能得到,但前提是你得知道这个 Form 的类名称。
    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
      if screen.ActiveForm is tform2 then
        caption:=(screen.ActiveForm as TForm2).str
      else  caption := 'FORM1';
    end;如果是控件、组件,就比较简单,用 controls 、components 属性就能解决。
      

  2.   

    自己顶
    (能否利用screen.ActiveForm在窗体的变量(比如:被激活窗体里面存在的integer,string,variant)得到呢?