I would like to be able to have my ribbon permanently minimized, then `expand` on mouse enter and `collapse` again on mouse leave.
The only events on the ToolbarManager I can see that might be useful is MouseEnterElement and MouseLeaveElement and in there set the
.minimized property of the ribbon. Even in those events the ribbon would minimize when going from one tool to another on the ribbon, I would then also need a way to check if the mouse is still over the ribbon or a toolbar to prevent `flashing`.
As far as I can tell though, these events only fire when the mouse enters or leaves a control on the ribbon, like a button or dropdown menu.
The events would then be skipped completely should the mouse wander over empty ribbon tab space or toolbar space.
Please advise if there is an easier way to accomplish this. Thanks in advance
I don't believe that is exposed. You can submit a feature request for this: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.
Also, I probably should have mentioned this earlier, but this technically violates the Office 2007 UI Guidelines. They state that you should not expand the ribbon based on the mouse hovering over a tab and it states that it must remain open regardless of mouse position, so it should not close up when the mouse leaves the tab page. Also, the guidelines state that the ribbon should not be minimized the first time the application is run. It should only be minimized if the user minimizes it.
Another question thgough. Is there a way to verify whether the ribbon is in a drop down position or not?
Nevermind. I see that calling .DropDown() basically toggles the drop down of the tab. Thanks
Works very well, thanks Mike.
One more issue though. The ribbon now drops down, but when the mouse
leaves the menu it does not collapse until the user clicks on another element on the form that's not on the ribbon. I cannot seem to find a corresponding "collapse" method for the ribbon as well?
Please advise. Thanks.
Sure, the Ribbon has a DropDown method which will show the tab drop down for the currently selected tab. However, you will probably want to change the currently selected tab before dropping down the ribbon. You can do this by just handling the MouseEnterElement event with the following code:
RibbonTabItemUIElement tabElement = e.Element as RibbonTabItemUIElement;
if ( tabElement == null ) return;
RibbonTab tab = tabElement.TabItem as RibbonTab;
if ( tab == null ) return;
tab.Ribbon.SelectedTab = tab;tab.Ribbon.DropDown();