开发者

DockPanel, TForm and OnClose event in Delphi

I have a project using DevExpress docking components, I create forms in run-time, which are attached into dockpanels components, my problem is that O开发者_StackOverflownClose event of these forms are suppressed when closing dockpanels and doesnot execute its code existing there, it is important TForm's OnClose event is executed 'cause there are taks that must be done. Any advice?

Thanks in advance.


Two ideas:

  1. If the docked forms are destroyed when the dock panel is closed: Move the code from the OnClose event to the form's constructor.
  2. If the dock panel class has an event similar to OnClose: Extract the relevant code from OnClose into a separate method and call this method from both the form's OnClose and the panel's OnClose.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜