• <bdo id='dIsT0'></bdo><ul id='dIsT0'></ul>
    <i id='dIsT0'><tr id='dIsT0'><dt id='dIsT0'><q id='dIsT0'><span id='dIsT0'><b id='dIsT0'><form id='dIsT0'><ins id='dIsT0'></ins><ul id='dIsT0'></ul><sub id='dIsT0'></sub></form><legend id='dIsT0'></legend><bdo id='dIsT0'><pre id='dIsT0'><center id='dIsT0'></center></pre></bdo></b><th id='dIsT0'></th></span></q></dt></tr></i><div id='dIsT0'><tfoot id='dIsT0'></tfoot><dl id='dIsT0'><fieldset id='dIsT0'></fieldset></dl></div>

  • <tfoot id='dIsT0'></tfoot>

    <small id='dIsT0'></small><noframes id='dIsT0'>

      1. <legend id='dIsT0'><style id='dIsT0'><dir id='dIsT0'><q id='dIsT0'></q></dir></style></legend>
      2. 默认情况下启用或禁用菜单项.为什么?

        时间:2023-12-02

          <small id='vYj5J'></small><noframes id='vYj5J'>

          <tfoot id='vYj5J'></tfoot>

              <i id='vYj5J'><tr id='vYj5J'><dt id='vYj5J'><q id='vYj5J'><span id='vYj5J'><b id='vYj5J'><form id='vYj5J'><ins id='vYj5J'></ins><ul id='vYj5J'></ul><sub id='vYj5J'></sub></form><legend id='vYj5J'></legend><bdo id='vYj5J'><pre id='vYj5J'><center id='vYj5J'></center></pre></bdo></b><th id='vYj5J'></th></span></q></dt></tr></i><div id='vYj5J'><tfoot id='vYj5J'></tfoot><dl id='vYj5J'><fieldset id='vYj5J'></fieldset></dl></div>
                <tbody id='vYj5J'></tbody>

                • <bdo id='vYj5J'></bdo><ul id='vYj5J'></ul>

                • <legend id='vYj5J'><style id='vYj5J'><dir id='vYj5J'><q id='vYj5J'></q></dir></style></legend>
                  本文介绍了默认情况下启用或禁用菜单项.为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一些遗留代码,出于某种原因,菜单项在启动时被启用或禁用.我的问题是,如何?有没有办法在不调用 EnableMenuItem() 函数的情况下做到这一点?有没有办法让 MFC 做与资源设置所说的相反的事情?

                  I have some legacy code and for some reason, menu items are being enabled or disabled on launch. My question is, how? Is there any way to do this without calling the EnableMenuItem() function? Is there a way for MFC to do the opposite from what the resource settings say?

                  当最后一个子窗口关闭时,我也不知道为什么在 SDI 中禁用或重新启用当前的.这可能是因为我对框架的理解不够好,我以为我已经通读了所有文档 此处.

                  I'm also at a loss as to why the current ones are being disabled or reenabled in a SDI when the last child window has closed. This is probably due to me not understanding the framework well enough and I thought I've read through all of the docs here.

                  推荐答案

                  使用 MFC,如果没有 ON_UPDATE_COMMAND_UI 处理程序也不是 菜单项的 ON_COMMAND 处理程序 -- 根据 这篇 MSDN 文章,

                  With MFC, menu items could be disabled if there is neither a ON_UPDATE_COMMAND_UI handler nor a ON_COMMAND handler for the menu item -- according to this MSDN article,

                  如果框架在执行过程中没有找到 ON_UPDATE_COMMAND_UI 条目命令路由,它会自动启用用户界面对象,如果某处有一个具有相同命令 ID 的 ON_COMMAND 条目.否则,它将禁用用户界面对象...可以禁用用户界面对象的默认禁用.有关详细信息,请参阅 MFC 参考中 CFrameWnd 类的 m_bAutoMenuEnable 成员

                  If the framework does not find an ON_UPDATE_COMMAND_UI entry during command routing, it automatically enables the user-interface object if there is an ON_COMMAND entry somewhere with the same command ID. Otherwise, it disables the user-interface object ... It is possible to disable the default disabling of user-interface objects. For more information, see the m_bAutoMenuEnable member of class CFrameWnd in the MFC Reference

                  [这适用于菜单项和工具栏项]

                  [this applies to menu-items and toolbar-items]

                  这篇关于默认情况下启用或禁用菜单项.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 Qt 聚焦 menuBar() 下一篇:对所有 USB 设备使用 RegisterDeviceNotification()

                  相关文章

                    <i id='33OSy'><tr id='33OSy'><dt id='33OSy'><q id='33OSy'><span id='33OSy'><b id='33OSy'><form id='33OSy'><ins id='33OSy'></ins><ul id='33OSy'></ul><sub id='33OSy'></sub></form><legend id='33OSy'></legend><bdo id='33OSy'><pre id='33OSy'><center id='33OSy'></center></pre></bdo></b><th id='33OSy'></th></span></q></dt></tr></i><div id='33OSy'><tfoot id='33OSy'></tfoot><dl id='33OSy'><fieldset id='33OSy'></fieldset></dl></div>
                  1. <legend id='33OSy'><style id='33OSy'><dir id='33OSy'><q id='33OSy'></q></dir></style></legend>
                  2. <small id='33OSy'></small><noframes id='33OSy'>

                    <tfoot id='33OSy'></tfoot>
                      <bdo id='33OSy'></bdo><ul id='33OSy'></ul>