帮助查找 CMFCMenuBar 上的工具提示问题

发布于 2024-08-09 16:44:58 字数 432 浏览 8 评论 0原文

我有一个使用功能包中发布的新 UI 功能的 MFC 应用程序,但我在使用菜单栏上的工具提示时遇到了问题。

默认情况下,我相信菜单项上未启用工具提示。然而,每当我将鼠标悬停在任何菜单列表中的第二项上时,我都会在弹出窗口中看到带有“无标题”的工具提示。唯一不会发生这种情况的是当第二项是分隔符时。这只发生在第二个项目上,不会发生在列表中的任何其他项目上。同样奇怪的是,当鼠标悬停在“编辑”顶级菜单项上时,会出现一个工具提示弹出窗口。

为了说明这一点,顶级菜单:

文件编辑视图帮助(将鼠标悬停在“编辑”上会显示工具提示)

说明文件菜单

文件 新的 打开 节省 另存为

(将鼠标悬停在“打开”上会显示工具提示)

每个菜单部分上的第二个项目也会出现相同的行为。其他菜单项均不显示工具提示。

非常感谢任何关于我如何确定这个问题的帮助。

I have an MFC app using the new UI features released in the Feature Pack and I'm having trouble with tooltips on the menubar.

By default, I beleive tooltips are not enabled on menu items. Yet whenever I hover over the 2nd item in any of the menu lists I get a tooltip with "Untitled" in the popup. The only time this does not occur is when the second item is a seperator. This only occurs on the 2nd item, not on any other item in the list. What's also odd is that a tooltip popup appears when hovering over the "Edit" top level menu item.

So to illustrate, top level menu:

File Edit View Help (Hovering over "Edit" displays the tooltip)

To Illustrate the File menu

File
New
Open
Save
Save As

(Hovering over "Open" displays the tooltip)

Again the same behavior occurs for the second item on each of the menu sections. None of the other mennu items display tooltips.

Any help on how I might be able to pin down this probelm is much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枫以 2024-08-16 16:44:58

发现问题了。无需深入了解背景故事,我必须将另一个项目的资源 ID 合并到该项目的 Resource.h 文件中。在一个非常旧的项目中,IDR_MAINFRAME 设置为 2。 MFC 显然不喜欢 2 作为此资源 ID。我将其更改为 128,这似乎是新应用程序向导使用的默认值。现在一切都很好。

Found the problem. Without going into the back story, I had to merge resource ID's from another project into the Resource.h file in this project. IDR_MAINFRAME was set to a value of 2 from a very old project. MFC apparently does not like 2 for this resource ID. I change it to 128 which seems to be the default value used by the new app wizard. All is well now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文