我在一个BtnCloseClick中写:frmInput.Close;
                           frmInput.Free;frmInputClose事件: frmInput.Close;
                   frmInput.Free;但是会有问题,什么堆栈益处的问题;而且的话,有个时候可以正常关闭,有个时候却无法正常关闭当前活动子窗体不知道各位大哥是如何实现的呢??

解决方案 »

  1.   

    在子窗口的OnClose事件写下:
      Action:=caFree;
    这样就可以在BtnCloseClick事件中:
      frmInput.close;
      

  2.   

    把mdi子窗体设置为动态创建;
    在其close事件中写上
      action:=caFree;
    而不要写
      frmInput.Close;
      frmInput.Free;
    在BtnCloseClick中
      frmInput.Close;
      

  3.   

    在CLOSE事件中写入
    action:=caFree
      

  4.   

    frmInputClose事件: 不用写什么的啦,一句话
    action:=caFree;
      

  5.   

    在子窗口的OnClose事件写下:
      Action:=caFree;
    这样就可以在BtnCloseClick事件中:
      frmInput.close;
      

  6.   

    一行搞定。
    http://expert.csdn.net/Expert/topic/1830/1830978.xml?temp=.5713465