如何使用功能区类别切换视图?? [英] how to use Ribbon Category to switch view??

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

问题描述

嗨!我想使用两个功能区类别按钮在两个不同的视图之间切换,但是我发现它无法向该按钮添加事件处理程序.

有解决这个问题的提示吗?如果有一些示例,更好的是,实际上我是MFC的新手.

Hi ! I want to use two ribbon category buttons to switch between two different views, but I found it can''t add event handler to the button.

Is there any hint to solve this problem? Better if there is some sample, actually I''m new to MFC.

推荐答案



根据您的疑问,我想您正在使用MFC功能区.如果是这样,则应将问题标记为MFC.

无论如何,您要的内容都违反了Microsoft的准则.请参见 http://stackoverflow.com/questions/549518/using-ribbon-as的第一个答案-tab-control [^ ].

要实现您想要的功能,请添加一个视图面板",其中包含与视图一样多的按钮,并根据用户操作适当地切换视图.

欢呼声,
AR

PS:如果您不熟悉MFC,也可以使用系统的"Windows Ribbon Framework"控件.请参阅我的文章在Vista或Windows 7(WTL)下使用功能区UI来查看旧的和新的本机应用程序 [ ^ ].
Hi,

From your question wording I suppose you are using the MFC ribbon. If so you should tag the question as MFC.

Anyhow, what you are asking for is contrary to Microsoft''s guidelines. See the first answer at http://stackoverflow.com/questions/549518/using-ribbon-as-tab-control[^].

To achieve what you want add a View ''panel'' with as many buttons as your views, and appropriately switch your view on user action.

cheers,
AR

PS: if you are new to MFC you may as well use the system ''Windows Ribbon Framework'' control. See my article Relook your Old and New Native Applications with a Ribbon UI under Vista or Windows 7 (WTL)[^].


是的,可以这样做,但是确实很复杂.它不违反功能区指南,仅需查看Outlook 2010,有多种模式,邮件,日历,日记等.每种模式都有不同的功能区,因此可以创建一个视图功能区,这可能是用于根据视图切换功能区和内容.

因此,与MS一样,您最终将获得多个Home Ribbon,以及每个视图重复的其他任何功能.

我自己使用VS2008 C ++ SP1 Feature Pack做到了这一点,并且它也可以在VS2010中运行,减去了MS对面板所做的细微更改.

汤姆
Yes this can be done, but it is quite involved. It does not go against the Ribbon Guidelines, just take a look at Outlook 2010, there are multiple modes, Mail, Calendar, Journal etc... Each mode has different ribbons, so it is possible to create a View ribbon, which could be used to switch out the ribbons and contents based on the view.

So like MS, you will end up with multiple Home Ribbons, as well as any other repeated per view.

I have done it this myself using VS2008 C++ SP1 Feature Pack and it runs in VS2010 as well, minus one subtle change to the Panel that MS made.

Tom


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

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