Click here to Skip to main content
Licence 
First Posted 14 Sep 2003
Views 225,004
Bookmarked 106 times

Balloon Tips Galore!

By | 14 Sep 2003 | Article
An article describing the various forms of Balloon Tips

Introduction

This article introduces creating Balloon Tooltips, using available standard APIs. Balloon Tooltips can be very useful sometimes, however if used improperly can be painful for the user. Simply put, the code creates different types of balloon Tooltips. To use this, download the code, and choose the class you want to add in your project. Copy it over to your solution and you are ready to go. Have a look at the code behind the forms (Form1, Form2, Form3) in order to use it. The aim here was to keep the code as simple and modular as possible.

There are quite a few excellent articles on Code Project explaining how to create BalloonTips. Some even create them from scratch and are probably more feature rich. While I found these articles very informative, I also felt the need to use the original tips which come with Windows XP. The result is this simple API based project. Most of the code is based on this MSDN article.

I have omitted a notification kind of Tooltip or a Task Tray kind of balloon tip, just because there is already a good example on Code Project.

Using the code

All classes contain explanatory doc comments where necessary. Also code has been provided in both VB and C# to help ease of usage. The solution has been created in VS. NET 2003, hence may not be usable from VS. NET 2002, However the source code shouldn't be a problem.

HoverBalloon: Instead of showing a Tooltip over a control, a balloon tip can be shown over the control. Use this in cases where you want to attract the user's attention to detail. Use this sparingly in your application, so that user doesn't end up seeing a festival of balloons scattered over the form.

MessageBalloon: Has more control over the display of the balloon. The stem, location of the balloon can be changed with this class. This can be shown and hidden at will. Use this whenever you need a non-modal message box.

EditBalloon: Notice how a balloon comes up while entering the password in a edit control, if the CAPS lock is pressed accidentally ? It just reminds the user, but doesn't stop the process. Use this class as a reminder to the user while entering key edit fields.

If using VS. NET 2002 then a manifest file needs to be added to the directory in which the binary resides. (Find one in the 'bin' directory of download). If using VS. NET 2003 then Application.EnableVisualStyles() needs to be called before any form is loaded.

Enjoy the code, any feedback is appreciated.

Points

If the user has disabled BalloonTips in the registry then this probably wont work. This hasn't been tested on operating systems other than XP, so probably it won't work there.

Future Improvements

Provide designer support similar to the Tooltip control, by deriving from System.ComponentModel.Component class, similar to the System.Windows.Forms.ToolTip class at design time.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

ramshri

Web Developer

United States United States

Member

Ramesh is very much into Microsoft technologies, and silently marvels at the power of Windows SDK.
He juggles his time between his family, work and his motorcycle.
 
Find this and other code from THE source code repository at
Total .NET SourceBook

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionRightToLeft Support Pinmembercearsh21:47 11 May '12  
GeneralMy vote of 5 Pinmembermanoj kumar choubey4:01 23 Mar '12  
GeneralMy vote of 5 Pinmemberjtxd22:05 5 May '11  
GeneralMy vote of 5 Pinmemberraiserle9:39 7 Apr '11  
QuestionHow to show the balloon tooltip using the TTM_POPUP message Pinmemberfeg200010:17 27 Aug '10  
Questionhow to disable windows' balloon PinmemberHZ22:43 16 Dec '09  
GeneralCrash on Windows 7 (64bit) PinmemberMember 34402110:47 16 Dec '09  
AnswerRe: Crash on Windows 7 (64bit) PinmemberHZ22:54 16 Dec '09  
GeneralRe: Crash on Windows 7 (64bit) PinmemberAlex Casamassima4:09 8 Jan '10  
GeneralRe: Crash on Windows 7 (64bit) PinmemberHimal1619815:36 3 Jun '10  
GeneralAnother Thanks PinmemberGary Huckabone9:37 8 Dec '09  
GeneralThanks Pinmemberoldsellerros3:30 30 Nov '09  
Generalensure message balloon dies when window changes or closes PinmemberBobishKindaGuy11:53 9 Apr '09  
AnswerRe: ensure message balloon dies when window changes or closes [modified] PinmemberKPEBEDKO22:23 13 Aug '09  
GeneralHoverBalloon disappears rather quickly PinmemberBobishKindaGuy0:37 4 Jan '09  
GeneralRe: HoverBalloon disappears rather quickly Pinmembersgennette8:54 9 Apr '09  
GeneralRe: HoverBalloon disappears rather quickly [modified] PinmemberBobishKindaGuy10:48 9 Apr '09  
GeneralRe: HoverBalloon disappears rather quickly Pinmembersgennette3:06 10 Apr '09  
GeneralRe: HoverBalloon disappears rather quickly PinmemberBobishKindaGuy9:15 10 Apr '09  
GeneralBalloonTip Visual Stype & WPF PinmemberRStern0:15 26 Aug '08  
QuestionHow to do it for richtextbox? PinmemberPriyank Bolia9:29 10 Apr '08  
GeneralHelp with edit tooltip Pinmemberrageit19:22 15 Jul '07  
GeneralEdit ToolTip Appears and dissapears PinmemberCarl Ja13:52 23 May '07  
GeneralRe: Edit ToolTip Appears and dissapears PinmemberCarl Ja16:28 23 May '07  
I also notice it does't work with other controls such as combobox and datepicker.
QuestionHOW TO ADD CUSTOM ICON PinmemberNicola Costantini6:10 12 Mar '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 15 Sep 2003
Article Copyright 2003 by ramshri
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid