May 30, 2007

Balloon-Tooltip with Close-Button

p. After reading several questions from people how try to create a “balloon tooltip with close button”, I digged a bit to find a solution. It seems that the try-notificaztion balloon-tip will always have this close-button on XP (maybe depending on the UI-style). But for normal balloon-tooltips it seems to be not possible. First I tried to look into the documentation of TTS_BALLOON. This was introduced with version 5.8 of the common controls (IE5). In the latest documentation for VS2003 (Jan 2006), I could not find any hint to get the close button into the balloon tooltip. Looking at the Vista-PSDK and documentation of TTS_BALLOON, you will see an “TTS_CLOSE” style! Ok, this seems to be the one I want to use! And wow, this TTS_CLOSE style is also availble in the PSDK which was shipped with VS2003! So it seems just the documentation is old.

 _ToolTipCtrl.Create(this, 

TTS_NOPREFIX|TTS_BALLOON|TTS_ALWAYSTIP|TTS_CLOSE);

Ok, after adding the style I tried the app and: nothing… no close-buttons…
Ok.. what next… I tried a new app in VS2005 and: the close button is there!
So: What is the difference between my VS2003 app and my new VS2005 app. The answer is simple: my new app has a manifest for the “Common Controls v6”!
So I tried to add a manifest to my “old” VS2003 and: voila: it also has the close buttons on the balloon tooltip.

Conlusion: If you want a close button, you need to

  • add TTS_CLOSE to you style
  • add a manifest for Common-controls-v6

Posted 5 months, 3 days ago on May 30, 2007
The trackback url for this post is http://blog.kalmbachnet.de/bblog/trackback.php/103/

Comments have now been turned off for this post