Hi,
I've the problem, that I need to translate all text on a form.
It works well with all controls, but I can't find how to iterate over all tooltips in a form.
I'm looking for something like this:
for each T as ToolTip in form.ToolTips
....
next
The TooltipManager does not expose any list of controls for which it is providing tooltips. So there is no simple way to do this.
The only way to do this would be to loop through every possible control and use the ultraToolbarsManager1.GetUltraToolTip method. But this is not a good way to do it for a number of reasons.
For one thing, the GetUltraToolTip method will always return an object. If the UltraToolTipManager is not already providing a tooltip to the control, then one will be created simply by calling the method. So you would end up creating a lot of unnecessary objects.
If you don't care about that, you would have to get the returned UltraToolTipInfo object and check it's properties like ToottipText to see if it is actually doing anything. But even this is not great, because there are other properties that can be set which would make a tooltip show up. You could have a tooltip with only a title, for example, or only an image and no text.
So there is currently no good way to do what you want here as far as I can see.
You should Submit a feature request to Infragistics and suggest that a method be exposed on the UltraToolTipManager which allows you to iterate the tooltips being provided. And perhaps we can add this functionality in a future release.
Hello Hristo,
yes I noticed these properties in the designer, but how can I reach the ToolTipText Property via code?
And the problem is more difficult. I have an assembly that can translate generic forms, without knowing the specific type of the form. This works because each form has a control collection.
The routine is like this:
translate(frm as System.Windows.Forms.Form, components as System.ComponentModel.IContainer)
The components are the private components of the given form.
With this information I'm be able to translate all controls and all menus (using with the UltraToolbarsManager). But no tooltips.
Bodo
Hello Bobo,
I completely agree with Mike. If you are using UltraTooltipmanager on way which is demonstrate on the following link:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.2/CLR2.0/html/WinToolTipManager_Set_Up_WinToolTipManager_at_Design_Time.html
you probably will note that tool tip is generated based on ToolTipText and ToolTipTitle of the control on which tool tip will be shows. In this case you could iterate the controls in form and translate ToolTipText and ToolTipTitle and tooltip must be translated too.
Let me know if you have any further questions.
Hi Mike,
I'm only working with the UltraToolTipManager, and want to iterate over his TollTips.
I don't beleive there is any generic way to iterate over all tooltips in an application, because there is no central repository of tooltips. Some controls have built-in tooltips that they provide and other tooltips are provided by components like UltraToolTipManager and the ToolTip class.