Solved

Tool Tips for windows in a CToolbar

Posted on 1997-09-09
5
380 Views
Last Modified: 2013-11-20
I have an application that uses SetButtonInfo() to add buttons to the end of a CToolbar.  I then create owner drawn buttons (sub-classed off CButton) as child windows of that toolbar.

The problem is that the tool tips aren't being displayed for these new buttons.  This worked perfectly in versions prior to Visual C++ 5.0.  I simply overrode OnNotify() and looked for the TTN_NEEDTEXT message (in my sub-class of CToolBar).  But now, I don't get this message for my new buttons.

Oh, another thing is that I need to provide the text for the tool tips dynamically, as they depend on user input (they can't come from the resource file).
0
Comment
Question by:Vance Kessler
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1306006
Have you allocated ID numbers to the new buttons?

Are they enabled/active?

0
 

Author Comment

by:Vance Kessler
ID: 1306007
Yes, they all have IDs and are enabled.  As I said earlier they worked perfectly before Visual C++ 5.0 came out.  Now the only thing that doesn't work are the tool tips.
0
 
LVL 8

Accepted Solution

by:
gelbert earned 100 total points
ID: 1306008
In your class derived from CToolBar you would have to overwrite virtual funcion OnToolHitText() which handles setting  tooltips text. And remember you have to allocate memory and copy your text into this memory then assing pointer to this memory to member of tooltip data structure.
0
 

Author Comment

by:Vance Kessler
ID: 1306009
Thanks, That is just what I needed.
0
 
LVL 8

Expert Comment

by:gelbert
ID: 1306010
Hi! If my answer is good enough for you, then I would appriciate if you would accept answer and award points
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now