MFC - 如何启用功能区? [英] MFC - how do I enable ribbon butons ?

查看:77
本文介绍了MFC - 如何启用功能区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我有一个问题:在VS2013中,使用向导,我创建了一个包含功能区的小型MFC项目。您已经知道,在这种情况下,VS会自动创建多个文件(View,Doc,MainFrm等)。如果我在其中一个自动创建的文件中创建功能区消息映射,则功能区中的按钮显示为启用,但如果我在由我手动创建的类中创建消息映射,则所有按钮都显示为禁用。为什么?我希望功能区的每组按钮都有一个单独的类。我不能把按钮的所有方法都放在一个类中,它不优雅。



非常感谢你!

迈克尔。



我尝试过:



pCmdUI->启用(真正);放入ON_UPDATE_COMMAND_UI没有任何效果。

Hello All,

I would have one question: In VS2013, using the wizard, I have created a small MFC project that contain a ribbon. You already know that in this case VS create automatically several files (View, Doc, MainFrm, etc.). If I create the ribbon message map in one of these files that was created automatically the buttons from ribbon appear enabled, BUT if I create the message map in a class created manually by me, all buttons appear disabled. Why? I want that for each group of buttons of the ribbon to have a separate class. I can't put all methods of the buttons in a single class, it's not elegant.

Thank you very much!
Michael.

What I have tried:

pCmdUI->Enable(true); put in ON_UPDATE_COMMAND_UI doesn't have any effect.

推荐答案

参见 c ++ - 禁用/启用MFC功能包的功能区按钮 - 堆栈溢出 [ ^ ]。


这篇关于MFC - 如何启用功能区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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