How do you reset an object's tooltip to its default?

 

Hi,

When hovering over an object you usually see a default tooltip. With vertical lines, for example, it is 3 rows:

1, the object's name,

2, the object's description,

3, the price at which your mouse pointer is intersecting that line.

You can change this with something like:

ObjectSetString(0,object_name,OBJPROP_TOOLTIP,"some text");

You can switch it off completely with a "\n":

ObjectSetString(0,object_name,OBJPROP_TOOLTIP,"\n");

Does anyone know how to switch it back to the original 3 rows please?

I cannot find an answer anywhere. Thanks for any input

 
Did you try using NULL instead of "\n" ?
 
William Roeder:
Did you try using NULL instead of "\n" ?

No, but i have now and it works. Thanks!

 

I observe that using the latest MT5 (build 3555, 23 Dec 2022), the default tooltip behavior is different from MT4.

Hovering over an object only displays TWO lines by default:  Object name; and the price at which the mouse pointer is at when the tooltip displays.   

Gone is the middle line with the Object Description that MT4 displays.  (WHY is MT5 different??)


Since one can set the OBJECT_TOOLTIP property to a string, how does one get the value for "the price at which the mouse pointer is at when the tooltip displays" ?

I tried "%$", similar to how a Fibo retracement can display the price for a given line.   I have no other ideas for what to try, and have not yet found any documentation for it.

      string desc = ObjectGetString(0,objName,OBJPROP_TEXT);
      string s_tooltip;
      StringConcatenate(s_tooltip,objName,"\n",desc,"\n%$");
      ObjectSetString(0,objName,OBJPROP_TOOLTIP,s_tooltip);

The object's description (at least when non-blank) is important to me.   But so is the price of the mouse pointer, and "%$" doesn't work.

Any ideas?   Thanks.

 

You can switch it off completely with a "\n":

ObjectSetString(0,object_name,OBJPROP_TOOLTIP,"\n");




Thanks.

Reason: