Hi ,
I want to hide the "All commands","All tabs" from choose command combo in Quick access toolbar customize window . please let me know how to achive this/
Hello Abi,
I have been investigating into a way to hide the “All Commands” and “All Tabs” options from the Quick Access Toolbar customize menu, and in order to do this, I would recommend first handling the BeforeCustomizationDialogDisplayed event of the UltraRibbonCustomizationProvider. In this event, the event arguments can get you the RibbonCustomizationDialog object that is opening.
From the dialog, you can recursively loop through the Controls collection and look for UltraComboEditor objects. Once you have these, you can use their ValueLists and remove the items that you are looking to remove from them. I am attaching a sample project that demonstrates how this can be done.
Please let me know if you have any other questions or concerns on this matter.
ToolbarsManagerCustomizationDialogDemo.zip
Thanks Andrew, i achieve with your solution. In the Customize QAT window , initially i set
StockItemModificationOptions = StockItemModificationOption.None;
but when selecting the tool from left side, for the selected tool , the
StockItemModificationOptions option is not mapped. which means those selected tool able to modify,remove.Is it possible to control this behaviour.
Thank you for your update on this matter, I am glad you were able to achieve your requirement with the solution provided.
I am rather unsure of what you are referring to by these “StockItemModificationOptions.” I am under the impression that this is one of the tools in your Ribbon, but I am unsure of what behavior you are looking to control? Would it be possible for you to please elaborate a bit further and possibly modify the sample project I sent you to outline this scenario?
Hello Andrew,
Thanks for your update . refer attached screenshot, . here eventhough StockItemModificationOptions set to none, still able to modify,show/Hide.
Is it possible to control this behaviour.
The StockItemModificationOptions apply to the tabs, groups, and tools that have their IsStockItem property set to true. This property is public, but it is not browsable, as the “stock” items are by default, the ones that are created at design-time.
If you want to set the IsStockItem property to true for all tabs, groups, and tools, you can call the CreateRestorePoint() method on the UltraToolbarsManager. Otherwise, while the IsStockItem property will not show in Visual Studio Intellisense as it is not browsable, you can still set it to true programmatically.
Now i understand StockItemModificationOptions property. Actually i want to hide the "Show/hide tool","Modify tool"
options for the Quick access tools.
screen shot with the highlighted. Is there a way to hide these optoins.
Thank you for your update on this matter.
In order to remove the customization options for the Quick Access Toolbar tools, a similar behavior as above must be followed. You either need to ensure that you call CreateRestorePoint on the UltraToolbarsManager prior to launching your customization dialog, or you need to ensure that the items in the UltraToolbarsManager.Ribbon.QuickAccessToolbar.Tools collection have the IsStockItem property set to true.
If your users are modifying the Quick Access Toolbar at runtime, you can catch the tool being added by handling the QuickAccessToolbarModified event on the UltraToolbarsManager and add the following code in the event:
var qatTool = ultraToolbarsManager1.Ribbon.QuickAccessToolbar.Tools[e.Tool.Key]; qatTool.IsStockItem = true;