Tool Tip Window Subclassing and Round Rectangluar Tool Tips.
This is an enhancement of Brad Martinez’s original
This article goes on further and creates rounded/shaped tooltips along with facility for colored borders, if you care!.
The following steps should be followed for creating the shaped ToolTip windows:
- Subclass the Tool tip COntrol window, Needs to be done after Creating it.
- Watch for Resize event. In it change the estimated size by some amount to for borders etc.
- Stop the Non-client paint event from drawing “black” line around the window
- Catch the Paint event, and do things yourself.
Instead of doing size adjustment in WM_Size, we should ideally do it in WM_NCCALCSIZE event. And Paint the borders in WM_NCPAINT – This way, we dont need to touch the WM_PAINT event (where now we are painting both border and the strings).
- Include this module in the project along with Brad Martinez code.
- Look into Form_load of this projects test form, to know how to use his code
- Dont set any control’s ToolTipText from Properties Window, otherwise both original and the new tool tip will show.
- Customise RR_Height value to your liking.
- Choose between simple rounded rect or some funny oval shape for borders, using the compiler switch “Try5Rgns”
- And any bugs report to me 🙂