How to change ribbon button tooltip dynamically? |
Post Reply |
Author | |
Beth
Groupie Joined: 10 December 2004 Status: Offline Points: 10 |
Post Options
Thanks(0)
Posted: 04 April 2013 at 2:06pm |
Is there a way to change ribbon button tooltip dynamically?
Thanks,
Beth
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
Use the SetTooltip method?
We subclass the ribbon bar and react to OnToolHitTest. We not only can change the text, but we can change the tooltip style (to xtpToolTipHTML) to affect the style of individual ribbon controls. |
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
|
Beth. Ignore what I said! When OnToolHitTest is called, if you change the style CJ deletes the current tooltip. That would be fine since it is in instance data but the code that calls OnToolHitTest has a copy of the pointer to the tooltip that gets deleted. So that is a show stopper.
It looks like you cannot change the style dynamically during an OnToolHitTest call. And the methods on the stack to get to OnToolHitTest are not virtual until you get to CXTPCommandBar::OnWndMsg. So at that point you can switch styles but you don't know what control will be hit. I simply don't see a way to change styles based on the control itself. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |