Share via

MFC CToolTipCtrl SetTextColor and SetBackgroundColor doesn't work

Ji Shirley 181 Reputation points
2021-02-25T01:26:33.26+00:00

I use a self-draw CTreeCtrl and want to show CToolTipCtrl text on each tree item.
I can change the text with TTN_NEEDTEXT,but
SetTipTextColor and SetTipBkColor don't work.

If I need to self-draw or use other tooltip class, could you give me some advice?
Thank you so much.

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.

0 comments No comments

Answer accepted by question author

Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
2021-02-25T05:58:35.41+00:00

Hi,

According to the Docs: TTM_SETTIPTEXTCOLOR message and TTM_SETTIPBKCOLOR message
When visual styles are enabled, this message has no effect.

As far as I'm concerned, This is the reason for SetTextColor and SetBackgroundColor doesn't work.

I suggest you could try to use NM_CUSTOMDRAW.

Best Regards,

Jeanine


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.