Search code examples
c#.netcontrolstooltip

Get all buttons with an assigned ToolTip


I want to get all buttons that have assigned ToolTip in the designer. I tried to do this using reflection but to add ToolTip to a buttons I added a ToolTip control to my form. Now all buttons have a property in designer called ToolTip on myToolTipControlName

obj is my button object and this code:

obj.GetType().GetProperties();

does not have a property called ToolTip and so on.

So how can I get this ToolTip text of a button? I need this text to translate mechanism to another language.


Solution

  • If t1 is your tooltip object then t1.GetTooltip(obj) will return the text for it.