16,748
社区成员
发帖
与我相关
我的任务
分享
Panel1 = new TPanel((TComponent*)NULL);
Panel1->Parent = this;
Panel1->FreeNotification(this); // <-- this is called automatically when assigning an Owner
...
void __fastcall TForm1::Notification(TComponent *AComponent, TOperation Operation)
{
TForm::Notification(AComponent, Operation);
if (Operation == opRemove)
{
if (AComponent == Panel1) Panel1 = NULL;
else if (AComponent == Image1) Image1 = NULL;
else if (AComponent == Timer1) Timer1 = NULL;
}
}