`FormStyle = fsStayOnTop`。
// 專案選項移除 Auto-create
TForm1 *frm = new TForm1(this);
frm->ShowModal();
delete frm; // 用畢即釋放
// 針對 Panel1 內所有 TEdit 清空
for (int i = 0; i < Panel1->ControlCount; i++) {
if (Panel1->Controls[i]->ClassNameIs("TEdit")) {
dynamic_cast(Panel1->Controls[i])->Text = "";
}
}
`Components[]` 含所有擁有者元件,`Controls[]` 僅含父子關係的視覺控件。
HRGN hRgn = CreateEllipticRgn(0, 0, Width, Height);
SetWindowRgn(Handle, hRgn, TRUE);
// 設 BorderStyle=bsNone, BorderIcons=[]
void __fastcall TMDIChild::FormClose(TObject *Sender, TCloseAction &Action) {
Action = caFree; // 關鍵:釋放記憶體
}
建立時 `Application->CreateForm(__classid(TChild), &Child)` 即自動顯示。