如何存储打开的MDI窗体,就像IE里的窗口栏,每打开一个MDI窗体,会把它的Caption 加载到窗口列表里,然后在窗口列表那边单击也可以打开此MDI窗体,一旦这个MDI窗体关闭,其相应的窗口列表内容也跟着释放,谁有这方面的源码,能否发一下,谢谢!

解决方案 »

  1.   

    加一个TActionList可以看看Delphi里的DEMO代码里面有一个事件可以得到这些子窗口并且加入到菜单里
      

  2.   

    另一种方法就是找到MDI主窗口,然后在菜单中增加一个用来放窗口列表的菜单项如M1,这样在主窗口的属性windowmenu里选择m1就可以了。只要主窗口有创建子窗口就会在m1的菜单下加一个项。
      

  3.   

    Specifies the Window menu for an MDI parent form.Delphi syntax:property WindowMenu: TMenuItem;C++ syntax:__property Menus::TMenuItem* WindowMenu = {read=FWindowMenu, write=SetWindowMenu, stored=IsForm};DescriptionUse WindowMenu to get or set the Window menu for an MDI parent form. The Window menu is a standard menu in MDI applications. It contains commands that let the user manage the windows in the application. Menu items usually include Cascade, Arrange Icons, Tile, and so on. The Window menu also lists (at the bottom) the child windows that are currently open in the application. When the user selects one of these windows from the menu, the window becomes the active window in the application. Although this menu is commonly called the Window menu, it can have any name that corresponds to an existing menu item on the menu bar. The names of open child forms are merged onto the menu automatically at run-time.WindowMenu is meaningful only if the form is an MDI parent (that is, if the form抯 FormStyle property is set to fsMDIForm).
      

  4.   

    找到MDI主窗口,然后在菜单中增加一个用来放窗口列表的菜单项如M1,这样在主窗口的属性windowmenu里选择m1就可以了。只要主窗口有创建子窗口就会在m1的菜单下加一个项。我知道这个原理,有没有源码实现的
      

  5.   

    不需要代码,MDI里已经封装了这些功能。直接就会加进去了。在设计窗口里按我上面说的做就可以了!