Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to catch ribbon bar tab change? Collapse All
Subject Author Date
Robert Webb May 26, 2009 - 2:20 AM

Hi,


Is there a way to catch the event when we switch to a different tab in the ribbon bar?  (Either because user clicks on it, or keyboard navigation was used, or Ribbon_PageSelectionSet() was called).  I need a callback for that case, and need to know the old and new tabs/pages.


Can it be done?


Thanks,


Rob.

Technical Support May 26, 2009 - 2:01 PM

The CExtRibbonBar::Ribbon_PageSelectionSet() method is virtual and you can override it to catch the ribbon tab page selection changing event. The CExtRibbonBar::Ribbon_PageSelectionGet() method can be invoked in your overridden method before invoking the parent class method. This is how you can get index of the previously selected ribbon tab page. Please note, the previous selected page index can be -1 if there were no selected ribbon tab pages.
But the CExtRibbonBar::Ribbon_OnPageSelectionChanging() virtual method is more handy for catching the ribbon page selection changing because its provides you both new and old indices in parameters.