I have ribbon control on a form... The form has only two edit control with very small size... the Ribbon is properly displayed in the design mode (IDE VS2005)... but when i run the application the ribbon is not displayed properly (no tools and no round button). Only the centralized caption/title of the form is displayed in centre....
while running the application, when i resize the form... then after increasing the size of form, the ribbon displays properly but it leaves many free space on the form which is useless for me (and against the UI)
Please help me that how could i make the ribbon control visible for forms having small size with couple of inpue controls...
Thanks,
- Kashif
It sounds like your form at runtime is smaller than the ribbon's auto collapse threshold. Try setting the AutoCollapseThresholdHorizontal and AutoCollapseThresholdVertical to 0. These properties are defined on the Ribbon and to set them you must set Office2007UICompatibility on the toolbars manager to False.
Thanks it really helped...
Can you also help me to Disable/Hide the "Customize Quick Access Toolbar" button on ribbon control next to the TOOLS on ribbon...
Kashif
You would need to do this manually by implementing a custom creation filter and assigning an instance of it to the CreationFilter property of the toolbars manager. Here is a filter that should remove the button:
public class MyCreationFilter : IUIElementCreationFilter{ void IUIElementCreationFilter.AfterCreateChildElements( UIElement parent ) { if ( parent is RibbonCaptionAreaUIElement ) { for ( int i = 0; i < parent.ChildElements.Count; i++ ) { if ( parent.ChildElements[ i ] is QatQuickCustomizeToolUIElement ) { parent.ChildElements.RemoveAt( i ); break; } } } }
bool IUIElementCreationFilter.BeforeCreateChildElements( UIElement parent ) { return false; }}