form也可以,但是要在运行的时候。procedure TForm2.FormCreate(Sender: TObject); begin form2.WindowState:=wsMaximized; form2.Parent:=form1.Panel1; end;
呵呵,这个帮助里有写啊 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.
begin
form2.WindowState:=wsMaximized;
form2.Parent:=form1.Panel1;
end;
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.