A.FormStyle:=fsMDIForm
B.FormStyle:=fsMDIChild
在B的单元写一个函数(注意,不是B的成员函数):
function MyMDIChildProc(hwndMe:HWND;uMsg,wParam,lParam:DWORD):Integer;sdtcall;
begin
if (uMsg = WM_SIZE) or (uMsg = WM_MOVE) then
Result := DefWindowProc(hwndMe,uMsg,wParam,lParam)
else
Result := DefMDIChildProc(hwndMe,uMsg,wParam,lParam);
end;