Solved

Tool Tips for windows in a CToolbar

Posted on 1997-09-09
5
386 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Get filename and folder into excel 7 75
VBA "SendKeys" Syntax for Multiple Keystrokes 7 108
Way to decrease size of apk file 9 68
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

778 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