Hi
How can i find a ButtonTool in the ToolAreaRight protion of my UltraToolBarsManager if i know the key of the button?? I want to remove a specific buttonTool.
A code sample of finding the tool from the key and removing it from the collection will be great!!
Hello Burmo,
You could achieve this through the following code:
ultraToolbarsManager1.Ribbon.ApplicationMenu.ToolAreaRight.Tools.Remove(ultraToolbarsManager1.Tools["ButtonTool2"]);
Please feel free to let me know if a question about our toolset comes up on your mind.
Thanks that worked.. however i have 2 more questions about this..
1) how can RE-ORDER the buttons in the ToolAreRight? I want to do a most recent list. and need to add the most recent at the top of the list and rest to follow under it.
2) how can i add an image to the button that appears on the ToolRightArea? ive tried the following code but it didnt work.
newBtnTool =NEW ButtonTool(cKey).
newBtnTool:SharedProps:Caption = cCaption.
newBtnTool:InstanceProps:AppearancesSmall:Appearance:Image = ilMdiManager:Images:Item[indx].
newBtnTool:SharedProps:DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle:ImageAndText.
tbMain:Tools:Add(newBtnTool).
tbMain:Ribbon:ApplicationMenu:ToolAreaRight:Tools:AddTool(cKey).
1) Your option is to do something like this:
ultraToolbarsManager1.Ribbon.ApplicationMenu.ToolAreaRight.Tools.Remove(ultraToolbarsManager1.Tools["ButtonTool2"]); ultraToolbarsManager1.Ribbon.ApplicationMenu.ToolAreaRight.Tools.AddTool("ButtonTool2");
So ButtonTool2 will come at the last position.
2) This seems to be available only for the ToolsAreaLeft. If you like I can log this as a new product idea for you.
Hi Boris
I can see where you going with this but there will be case where i need to loop through the tools in the ToolRightArea and delete them from the colloction and then add them in under the new tool...
Any Ideas on how to do this?
You are right, this will be painful, please take a look at the following link and let me know if the mentioned there method suits your needs:
http://help.infragistics.com/NetAdvantage/WinForms/2012.2/CLR4.0/?page=Infragistics4.Win.UltraWinToolbars.v12.2~Infragistics.Win.UltraWinToolbars.ToolsCollection~InsertTool(Int32,String).html