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.

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)



Comments

  • not works with label control

    Posted by Legacy on 05/21/2003 12:00am

    Originally posted by: sonali s shah

    it works with only those control who as hwnd property
    
    i have to use this code to label control but it not works
    so guid me how to solve this provblem

    Reply
  • ms forms 2.0 controls. they do not have hwnd property

    Posted by Legacy on 09/24/2001 12:00am

    Originally posted by: Ed Stotz

    ms forms 2.0 controls do not have hwnd property. how would you adjust to handle.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Protecting business operations means shifting the priorities around availability from disaster recovery to business continuity. Enterprises are shifting their focus from recovery from a disaster to preventing the disaster in the first place. With this change in mindset, disaster recovery is no longer the first line of defense; the organizations with a smarter business continuity practice are less impacted when disasters strike. This SmartSelect will provide insight to help guide your enterprise toward better …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds