如何在代码中向CMFCRibbonBar添加类别,面板和命令? [英] How to add category, panel and command to CMFCRibbonBar in the code?

查看:207
本文介绍了如何在代码中向CMFCRibbonBar添加类别,面板和命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我们的应用程序中创建一个使用CMFCToolBar的功能区栏,以便用户可以在菜单/工具栏界面和功能区界面之间切换。尽管事实上只有一个命令在
功能区中没有添加任何图标,但交换机仍在工作。

I am trying to create a ribbon bar in our application which uses CMFCToolBar, so that the user can switch between menu/toolbar interface and ribbon iterface. The switch is working despite the fact that there is only one command without any icon added in the ribbon.

功能区栏是使用功能区编辑器创建的,但我无法添加命令的图标,图像索引始终为-1。

The ribbon bar is created using ribbon editor, but I could not add icons to the commands, the image index is always -1.

有没有其他方法可以创建功能区?是否可以在代码中添加项目而不是功能区编辑器?这样我就可以使用现有资源为每个命令设置图标。

Is there any other ways to create the ribbon? Is it possible to add items into the ribbon in the code instead of ribbon editor? So that I can set the icon for each command using existing resources.

提前致谢。

推荐答案

b

Hi,

感谢您在这里发帖。

Thanks for posting here.

>>如何在代码中向CMFCRibbonBar添加类别,面板和命令?

我正在尝试创建功能区栏在我们的应用程序中使用CMFCToolBar,以便用户可以在菜单/工具栏界面和功能区之间切换。尽管事实上只有一个命令没有在功能区中添加
的任何图标,但交换机仍在工作。


>>How to add category, panel and command to CMFCRibbonBar in the code?
I am trying to create a ribbon bar in our application which uses CMFCToolBar, so that the user can switch between menu/toolbar interface and ribbon iterface. The switch is working despite the fact that there is only one command without any icon added in the ribbon.

对于你的标题,我建议你参考
Ribbon Designer MSDN上的(MFC)


For your title, I suggest you refer to the Ribbon Designer (MFC) on the MSDN.

如果你想切换菜单/工具栏界面和功能区,可能这些链接可以帮到你。

1.
基于CMFCRibbonBar的Ribbon接口与基于CMFCMenuBar / CMFCToolBar的接口即时切换


2. a href ="https://www.codeproject.com/Articles/140647/How-to-Support-the-Ribbon-and-a-Menu-in-the-Same-E">
如何支持功能区和相同可执行文件中的菜单

If you want to switch the menu/toolbar interface and ribbon iterface, maybe these links will help you.
1. Switching between CMFCRibbonBar based Ribbon interface and CMFCMenuBar/CMFCToolBar based interface on-the-fly
2. How to Support the Ribbon and a Menu in the Same Executable

希望这些能为您提供帮助。

Hope these will help you.

祝福,

杰克 


这篇关于如何在代码中向CMFCRibbonBar添加类别,面板和命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆