delphi7.0 怎样设置 打开程序主窗体之后

2025-05-13 12:20:30
推荐回答(1个)
回答1:

将formstyle设为fsmidform.子设成fsmidchild.
API:
The SetParent function changes the parent window of the specified child window. HWND SetParent(
HWND hWndChild, // handle to window whose parent is changing
HWND hWndNewParent // handle to new parent window
);

VCL:
Sets the parent of the control.
procedure SetParent(AParent: TWinControl); virtual;
Description
SetParent is the protected implementation of the Parent property. Override SetParent to execute additional code when the value of the Parent property changes.
The AParent parameter specifies the new parent of the control.

If the control already has a parent, SetParent removes the control from that parent's list of controls by calling the parent's RemoveControl method. If AParent is not nil, SetParent calls its InsertControl method to add the control to its list of controls.

The TControl destructor calls SetParent(nil)to remove the control from its parent's control list before destroying the component.