MDI Application中怎样拦截系统自动添加的TMenuitem?并怎样控制让它不能添加?

kikic99 2004-03-29 10:19:47
MDI Application的MainForm中对windowMenu属性设定一个菜单项,在每创建并打开一个fsMDIChildForm后,系统会在该菜单项下自动添加一个TMenuitem并显示成子窗口的Caption,怎样可以人工干预让它创建或是不创建呢?
分数不是问题,给多少都行
...全文
79 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
kikic99 2004-03-30
  • 打赏
  • 举报
回复
>TO godnoloveihavelove:

>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.

多谢!
我正在做一个MDI application,为了界面好看,我用了一个child window来布置界面放在工作区,可是我不想它被The Window menu lists,主要是想防止用户通过菜单将它激活,the window becomes the active window in the application,破坏整个application的布局.

我曾设想是否可以通过消息机制来解决,但我不知道该怎么做

godnoloveihavelove 2004-03-29
  • 打赏
  • 举报
回复
Specifies the Window menu for an MDI parent form.

property WindowMenu: TMenuItem;

Description

Use 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).

你说的例子在DEPHI下(最起码用普通代码来写很麻烦),你不如使用C++来写,这样你可以有更好的控制能力,或者你可以自己创建一个类,或者修改FORM类的核心来完成,不过这样你就丢失了好多便利的功能,我不知道你为什么要想有这样的功能,不过可以告诉你,使用可视化编程方法做很困难,也许得不偿失
godnoloveihavelove 2004-03-29
  • 打赏
  • 举报
回复
你写个例子发给我,我看不懂你到底是要做什么

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧