Change tooltip of Ribbon button using Runtime Ribbon API (not CUI API)

By Adam Nagy

I want to change the tooltip of my ribbon button. I was hoping to do it like this:

thisCmdbutton.ToolTip.Title = tipTitle;

thisCmdbutton.ToolTip.Content = tipContent;

Unfortunately RibbonButton.ToolTip does not seem to have any string properties.

Solution

RibbonButton.ToolTip simply returns an object, but you can cast it to RibbonToolTip:

RibbonToolTip toolTip = myRibbonButton.ToolTip as RibbonToolTip;

if (toolTip == null)

  return;

 

toolTip.Title = "New Title";

toolTip.Content = "New Content";


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading