首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

关于Form释放的方法

2012-03-06 
请教各位 关于Form释放的方法在FormA的onclose里写 Action caFree然后在别的Form里写for(int i 0 i

请教各位 关于Form释放的方法
在FormA的onclose里写 Action = caFree;

然后在别的Form里写
for(int i = 0; i < Screen->FormCount; i++)
{
  if(Screen->Forms[i]->Name == "FormA")
  Screen->Forms[i]->Close();
}

或者写
if(Application->FindComponent("FormA") != NULL)
  ((TFormA *)Application->FindComponent("FormA"))->Close(); 

可是在执行了上面两句后用
for(int i = 0; i < Screen->FormCount; i++)
  ShowMessage(Screen->Forms[i]->Name);

还是能找到FormA
有没有别的办法把FormA彻底释放掉

[解决办法]
我一般都是倒着来,也就是从FormCount递减为0
[解决办法]
支持妖哥

热点排行