Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, now am in MFC project in which i am using document/view and MFC Ribbon's. I inherit my view class from CListView. I need to change my list ctrl columns when ribbon categories are switched.

In my search i found there is no event for Ribbon category selection change. I post question about this problem in many forums but i cant get the solution.

But some guys told me to use ON_UPDATE_COMMAND_UI() for the first button in every category but this also not suited because the handler is called for every WM_PAINT. If any one have any other idea for update my view when category selection change pls share with me guys......

Thanks in advance
ganeshIT
Posted

1 solution

Dear ganeshIT,

clarify your question intelligibly.
1)Do you wnats to update the list view control?

2)Do you wants to set the selection change programatically.

Ans 1:
Use RedrawItems API.

BOOL RedrawItems( int nFirst, int nLast );
Forces a list view control to repaint a range of items.

The specified items are not actually repainted until the list view window receives a WM_PAINT message. To repaint immediately, call the WindowsUpdateWindow function after using this function.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900