A 'real' Round Tool Tip Control | CodeGuru

A ‘real’ Round Tool Tip Control

Tool Tip Window Subclassing and Round Rectangluar Tool Tips. This is an enhancement of Brad Martinez’s original code for how to create tool-tip windows and provide multi-line tool tips. Many thanks to Brad for allowing us to use and expand upon his original code. This article goes on further and creates rounded/shaped tooltips along with […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 3, 2004
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Tool Tip Window Subclassing and Round Rectangluar Tool Tips.

This is an enhancement of Brad Martinez’s original code for how to create tool-tip windows and provide multi-line tool tips. Many thanks to Brad for allowing us to use and expand upon his original code.

screen-shot

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:


  1. Subclass the Tool tip COntrol window, Needs to be done after Creating it.

  2. Watch for Resize event. In it change the estimated size by some amount to for borders etc.

  3. Stop the Non-client paint event from drawing “black” line around the window

  4. Catch the Paint event, and do things yourself.

Future Ideas/Implementations

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).

Implementation


  • 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 🙂

Download Round ToolTips Project (25k)

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.