Click here to Skip to main content
13,089,818 members (47,111 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi guys, now am in a MFC project which contains rich ribbon controls.
I am using document view architecture and i inherit my view class from CListView.
In my UI design i have 6 category ribbons, i need to change my list view when category ribbons are selected.

Is there any notification is for category selection change. i dont know how to do it and also i need to do command routing from my CMainFrame to CDocView. How can achieve these two.......

If you know guide me.....

Thanks in advance
Posted 9-Mar-11 23:51pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

I'm sure this is outdated question, but here's the straight answer.
Add this to you message map in MainFrm.cpp:

then, declare and implement method OnRibbonCategoryChanged:
LPARAM CMainFrame::OnRibbonCategoryChanged(WPARAM wp, LPARAM lp)
	CMFCRibbonCategory *pCategory=m_wndRibbonBar.GetActiveCategory();
	int nCategory=m_wndRibbonBar.GetCategoryIndex(pCategory);
	//... do something
	return 0;

The nCategory variable holds current category index (starting with one, left to right).
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi guys, i found solution for my problem. There is r registered message AFX_WM_ON_CHANGE_RIBBON_CATEGORY.

MFC Frame work send this message to the framewnd when category is changed. It LPARAM contains pointer to the CMFCRibbonBar using this we can get our active category name.

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Thanks for your good question and answer!
I really need this information because i have been looking for this message!

Kind regards,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 14 Apr 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100