[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 404
  • Last Modified:

Tool Tips for windows in a CToolbar

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
Vance Kessler
Asked:
Vance Kessler
  • 2
  • 2
1 Solution
 
RONSLOWCommented:
Have you allocated ID numbers to the new buttons?

Are they enabled/active?

0
 
Vance KesslerAuthor Commented:
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
 
gelbertCommented:
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
 
Vance KesslerAuthor Commented:
Thanks, That is just what I needed.
0
 
gelbertCommented:
Hi! If my answer is good enough for you, then I would appriciate if you would accept answer and award points
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now