I have an application using the ribbon and have set up images for large and small sizes and tool tips etc. but would like the user to be able to alter the size of the images, if the items are displayed as text, image or text+image and assign shortcuts. I know this is possible if you are using toolbars does anyone know how to do it using the tibbon?
Best RegardsGraham Wade
Hello Wade,
RibbonGroup has a property PreferedToolSize which determine the preferred displayed size of the tool, so you could iterate throw all RibbonGroup and set this property to one of RibbonToolSize enumerator. You could use code like this :
foreach (RibbonTab tab in ultraToolbarsManager1.Ribbon.Tabs)
{
foreach (RibbonGroup group in tab.Groups)
group.PreferredToolSize = RibbonToolSize. Large[ImageOnly,Normal, ..];
group.Settings.CanCollapse = Infragistics.Win.DefaultableBoolean.False;
}
tab.GroupSettings.CanCollapse = Infragistics.Win.DefaultableBoolean.False;
Let me know if you have any further questions.
Hristo
Thanks for the info on image sizes. I was really looking for a built-in customisation dialog such as is included with toolbars. Do I assume from your response that their isn't one and so I will have to generate one myself?
Hello,
UltraToolBarsManager has built in customization dialog, which allows you to customize some properties of the tools. To be able to display CustomizeDialog at runtime you should set Office2007UICompatibility of UltraToolbarsManager to false. You could display CustomizeDialog
With ultraToolbarsManager.Customize();. May be this is what you are looking for.
I have followed the thread and successfully showed builtin customization form for ultraToolBar. In any case such a way allows only to manage ToolBars and does not allow to interact with robbon groups and tabs. Is there a built in way to obtain such a result? It could be very hard to reimplement all that.
Please advice.
Marcello
What I ended up doing is calling toolbarmanager.customise from a menu item. This displays the toolbar customise and allows shortcuts etc to be set for toolbar items. I then set the size of the ribbon tool images to be the same as that specified for the toolbars in the customisation dialog. This basically invlolves looping through all tabs/ groups/ items in the ribbon and setting the preferred size.
Hope this help
RegardsGraham Wade