Is there a way to set the Tooltip text for the "Minimize Ribbon" Menu item?
Hello,
Please try the following code which uses UltraTooltipManager:
UltraToolTipInfo info = new UltraToolTipInfo(); private void ultraToolbarsManager1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (e.Element is TextUIElement && e.Element.Parent is MinimizeRibbonUIElement) { info.ToolTipText = ((TextUIElement)e.Element).Text; ultraToolTipManager1.SetUltraToolTip(this, info); ultraToolTipManager1.ShowToolTip(this); } else ultraToolTipManager1.HideToolTip(); }
Please do not hesitate to contact us if you need any additional assistance.
This did not worked - it does not enter if (e.Element is TextUIElement && e.Element.Parent is MinimizeRibbonUIElement) condition.
It looks like it is barried deeper: (e.Element.Parent.Parent as ToolbarUIElement).ChildElements[0] as ButtonToolUIElement)).Tool.
Still no idea how to get MinimizeRibbonUIElement...
Your sample works because you have Style set to Default.
We are using Style "Office2010" and Office2007UICompatibility is set to False. When style is "Office 2010" there is no drop down menu and the code does not work.
I tried this and it always works fine for me so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
This sample does not work. Not sure if it matters, but I am running Windows 7 Service pack1.
It looks like "Minimize ribbon button" in Office 2010 style does not have TextUIElement attached to it.
It looks like we have been in some sort of misunderstanding here, please switch the condition with the following one:
if (e.Element is Infragistics.Win.ImageAndTextUIElement.ImageAndTextDependentTextUIElement && e.Element.Parent.Parent is ButtonToolUIElement)
and use the following code in order to remove the default tooltip:
this.ultraToolbarsManager1.Ribbon.TabItemToolbar.Settings.ShowToolTips = Infragistics.Win.DefaultableBoolean.False;
Please feel free to let me know if I misunderstood you or if you have any other questions.
This condition is very generic, i.e. if you add another button tool next to the "Minimize Ribbon" , the condition would be met for it as well. Is there a way to identify "Minimize Ribbon" tool?
Everything seams working fine. Thanks a lot.
This is good. I was searching for other tools like this, which do not have the Key property set and was not able to find such.
It seams that this condition matches all other button tools on the toolbar tabs.
It seams though that (ButtonToolUIElement)e.Element.Parent.Parent).Tool.Key for MinimizeRibbonTool is empty. So if I use the everything seams to be working:
if (e.Element is Infragistics.Win.ImageAndTextUIElement.ImageAndTextDependentTextUIElement && e.Element.Parent.Parent is ButtonToolUIElement
&& ((
ButtonToolUIElement)e.Element.Parent.Parent).Tool.Key == string.Empty)
All tools that we add will have the Key property set. The question is is there other build-in tools on the toolbar that will have Key property empty?
I am extending the condition then:
if (e.Element is Infragistics.Win.ImageAndTextUIElement.ImageAndTextDependentTextUIElement && e.Element.Parent.Parent is ButtonToolUIElement && !this.ultraToolbarsManager1.Ribbon.TabItemToolbar.Tools.Contains(((ButtonToolUIElement)e.Element.Parent.Parent).Tool))
Please do not hesitate to contact me if you need any additional assistance.