DELPHI5下有一个FRAMES\DB里的一个示例,主窗体上用的控件是在子窗体上产生出来的,不知道是如何实现的?

解决方案 »

  1.   

    NewItem--Frame在上面添加控件,然后在Frame上右键--Add to Pallete
      

  2.   

    多谢,不知道原理是什么呢?FORM怎么不可以?
      

  3.   

    form也可以,但是要在运行的时候。procedure TForm2.FormCreate(Sender: TObject);
    begin
      form2.WindowState:=wsMaximized;
      form2.Parent:=form1.Panel1;
    end;
      

  4.   

    呵呵,这个帮助里有写啊
    A frame, like a form, is a container for other components. It uses the same ownership mechanism as forms for automatic instantiation and destruction of the components on it, and the same parent-child relationships for synchronization of component properties. (从这开始写的就是frame和form的不同了,也就是楼主说的可以把frame存成组件再利用)But frames can be nested within forms or other frames, and they can be saved on the Component palette for easy reuse. After a frame is created and saved, it continues to function as a unit and to inherit changes from the components (including other frames) it contains. Moreover, an embedded frame continues to inherit changes made to the frame from which it is derived.
      

  5.   

    在逻辑关系上,用from2调用form1的根本不行,就算行得到的也不是frame达到的效果