Print Page | Close Window

How to change ribbon button tooltip dynamically?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=21575
Printed Date: 17 April 2025 at 11:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change ribbon button tooltip dynamically?
Posted By: Beth
Subject: How to change ribbon button tooltip dynamically?
Date Posted: 04 April 2013 at 2:06pm
Is there a way to change ribbon button tooltip dynamically?
 
Thanks,
Beth



Replies:
Posted By: rdhd
Date Posted: 10 September 2013 at 3:44pm
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.


Posted By: rdhd
Date Posted: 11 November 2013 at 11:38am
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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net