Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9279595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T17:40:22+00:00 2026-06-18T17:40:22+00:00

How can I make a toolTip text updating itself each time the tooltip is

  • 0

How can I make a toolTip text updating itself each time the tooltip is (about to be) displayed ?

I have a CDialog derived dialog which uses CToolTipCtrl tooltips in the usual way and it works just fine:

  • CToolTipCtrl member variable in my CDialog class.
  • created tooltip and added to tool in CDialog::OnInitDialog
  • message relayed to the CToolTipCtrl in CDialog::PreTranslateMessage

I also know how to update the toolTip text in various places of the code using CToolTipCtrl::UpdateTipText and CToolTipCtrl::Update

However, what I want and have not yet accomplished is this:
I want that the text of the tooltip updated each time the mouse hoovers over the tool before the according tooltip is displayed, i.e. the displayed text is dependent on the situation the moment the tooltip-text is displayed.

My working code so far (truncated to relevant lines):

class CmyDialog : public CDialog
{
  virtual BOOL OnInitDialog();
  virtual BOOL PreTranslateMessage(MSG* pMsg);
  virtual void RefreshToolTipText();        // Want to call this prior each display

  CToolTipCtrl m_toolTip;
}

BOOL CmyDialog::OnInitDialog()
{
  CDialog::OnInitDialog();
  m_toolTip.Create(this);
  m_toolTip.AddTool( GetDlgItem(IDC_SOMECONTROLID), "Sometext" );
  m_toolTip.Activate( TRUE );
}

BOOL CmyDialog::PreTranslateMessage(MSG* pMsg)
{
  if(IsWindow(m_toolTip.m_hWnd)) 
     m_toolTip.RelayEvent(pMsg); 
}

void CmyDialog::RefreshToolTipText()
{
  m_toolTip.UpdateTipText( "updated runtime text",  GetDlgItem(IDC_SOMECONTROLID) );
  m_toolTip.Update();   
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T17:40:23+00:00Added an answer on June 18, 2026 at 5:40 pm

    When calling CToolTipCtrl::AddTool use the “special” value LPSTR_TEXTCALLBACK as the text to use for the tooltip. This will cause the tooltip to post a TTN_NEEDTEXT notification to the parent of the window you are adding a tooltip for. The parent can then set the text accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In C#, how can I make a ToolTip remain displayed until the mouse move
Can someone tell me how I can make the following output? I have a
How can I make the Tooltip in the following code display faster? using System.Windows;
I have a tooltip that activates(shows) when the target text is hovered over. For
Hi all I try to make my own tooltip script which follow my mouse
I have below function which executes the qtip2 tooltip on certain divs ( #block_profile
How can you make the SimpleTip plugin use each element's title attribute for the
$('a.tooltip').each(function(){ $(this).qtip({ content: { url: 'includes/qtip.php?'+$(this).attr('rel')+' #'+$(this).attr('div'), text:'loading...' }, show: { delay: 400}, hide:
I have a View in which I'm using a tooltip provided by this site:
I can make my program write a .dat file with an array of Node

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.