Can anybody help me me to Disable/Hide the "Customize Quick Access Toolbar" button on ribbon control next to the TOOLS on ribbon...
Thanks,
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; }}
Hi! Can you please tell me where to insert this code.... Am just starting to learn these stuffs.. :)
thanks in advance..
You can define the class posted above anywhere in your project. Then, after the call to InitializeComponent in the Form's constructor, add the following line:
this.ultraToolbarsManager1.CreationFilter = new MyCreationFilter();
Hello. I know this thread is old, but i would like to accomplish what you had stated in this thread. I added the code as you suggested, but the option is still showing up.
I am using NetAdvantage for .NET 2008 Vol. 3 CLR 2.0
I have attached a picture as well showing which field i want to remove. This context menu appearss when i right click one of the Ribbons. IE: Calendar, Scheduling, Mechanic Views, etc.
Is this code for a different UI element? What would the proper element be to remove for this item? Thanks.
Any insight into why setting UltraToolbarManager.ShowQuickCustomizeButton = false does not have the desired effect?
Thanks!
Hello,
You could prevent the menu from showing, using the following code:
private void ultraToolbarsManager1_BeforeToolbarListDropdown(object sender, BeforeToolbarListDropdownEventArgs e) { e.Cancel = true; }