Solved

Tool Tips for windows in a CToolbar

Posted on 1997-09-09
5
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

707 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