In an application I use the ribbon.In the ToolAreaRight of the ApplicationMenuI add the UltraWinToolbars.ListToolthat I fill with the function ListTool.ListToolItems.Add(key,text)
I show the tooltip for the ListToolItem, using the events MouseEnterElement, MouseLeaveElement of the UltraToolbarsManager.From the e argument I can obtain the TextUIElement that have the property text.
Is it possible to obtain the key value that I specify in the Add above?
Hello ,
Thank you for sharing the sample .I discussed the matter with the team and right from TextUIElement we are also not able to find the key, instead try this:
Private Sub UltraToolbarsManager1_MouseEnterElement(sender As Object, e As UIElementEventArgs) Handles UltraToolbarsManager1.MouseEnterElement Try If TypeOf e.Element Is PopupMenuItemUIElement Then Dim elem As PopupMenuItemUIElement = TryCast(e.Element, PopupMenuItemUIElement) Dim context = elem.GetContext() Dim prop = context.[GetType]().GetProperty("ListToolItem", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance) If prop IsNot Nothing Then Dim listToolMenuItem = prop.GetValue(context) Dim menuString As String = listToolMenuItem.ToString() Dim key As String = menuString.Split("["c).Last().Replace("]", String.Empty) End If End If
Another option could be instead of listLool create a labelTool and using label.SharedProps.ToolTipText you can set the tooltip directly. something like this:
Dim label As UltraWinToolbars.LabelTool label = DirectCast(UltraToolbarsManager1.Tools("Label1"), UltraWinToolbars.LabelTool) label.SharedProps.ToolTipText = "this is label"
Hope this will help.
TestListToolItem.zip
Hello, I attach a zip with an example. In the code, I wrote the questions. Thanks
Hello Stefano,
Thank you for your post. In order to understand your scenario can ypu please attach your demo sample here. (mke sure you delete the dlls before attaching , to reduce the size of the application)