我在一个MDI程序中,需要在主窗口程序中控制当前活动的子窗口上的控件属性,应该如何实现?我的子窗口是动态创建的。
谢谢了!

解决方案 »

  1.   

    self.ActiveMDIChild.button1.caption:='gag';
      

  2.   

    我用了:
            MapForm:=self.ActiveMDIChild;
    出错信息为:Incompatible Types: "TMapForm" and "TForm"好像我只要把Form的名字改了就会变成一个新的类呀!(我以前使用VC的,刚刚接触Delphi,所以把“T”理解成VC里面的类了)
      

  3.   

    var i:integer;
    begin
    for i:=0 to self.ActiveMDIChild.ComponentCount-1 do
    begin
        if   self.ActiveMDIChild.Components[i] is TBUtton then
            Tbutton(self.ActiveMDIChild.Components[i]).caption:=inttostr(i);
    end;动用马甲了!这个凑合可以用!
      

  4.   

    我自己实现了:
    MapForm:=TMapForm(ActiveMDIChild);还是谢谢你了!