Click here to Skip to main content
15,867,453 members
Articles / Programming Languages / C#
Article

Balloon Tips Galore!

Rate me:
Please Sign up or sign in to vote.
4.90/5 (52 votes)
14 Sep 20032 min read 348.3K   7.9K   113   73
An article describing the various forms of Balloon Tips

Image 1

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


Written By
Web Developer
United States United States
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 computer.

Comments and Discussions

 
AnswerRe: problem with OpenFIleDialog, SaveFileDialog and FolderBrowseDialog Pin
marantz10-Jul-07 23:45
marantz10-Jul-07 23:45 
GeneralDirectly copied from MSDN bugs and all Pin
Mach00512-May-06 13:32
Mach00512-May-06 13:32 
GeneralRe: Directly copied from MSDN bugs and all Pin
Ramesh Shrivastav13-May-06 11:36
Ramesh Shrivastav13-May-06 11:36 
GeneralAccessViolationException: Bug in FMSEditTip.cs Pin
Mach00510-May-06 13:11
Mach00510-May-06 13:11 
GeneralRe: AccessViolationException: Bug in FMSEditTip.cs Pin
jose.mira1-Oct-08 3:44
jose.mira1-Oct-08 3:44 
QuestionHow can the EditBallon be hidden? Pin
User 17912914-Feb-06 2:53
professionalUser 17912914-Feb-06 2:53 
AnswerRe: How can the EditBallon be hidden? Pin
User 17912914-Feb-06 3:18
professionalUser 17912914-Feb-06 3:18 
QuestionHow to enable balloon on XP Pin
riscy19-Dec-05 20:23
riscy19-Dec-05 20:23 
It does not seem to work on XP
The code complies okay...but seem to be not enabled.
Any suggestion?.

Electronic Engineer keen to learn more of C# and .net programming. Currently using C and C++ for microcontroller application.
AnswerRe: How to enable balloon on XP Pin
Fabio Poroli4-Jan-06 3:59
Fabio Poroli4-Jan-06 3:59 
QuestionWhat with tray? Pin
Marcin Bobowicz (rent0n)24-Nov-05 23:00
Marcin Bobowicz (rent0n)24-Nov-05 23:00 
QuestionRight to Left Ballon Pin
AmirSasan10-Nov-05 10:38
AmirSasan10-Nov-05 10:38 
AnswerRe: Right to Left Ballon Pin
freshonlineMax4-Mar-06 18:21
freshonlineMax4-Mar-06 18:21 
NewsUpdate Balloon Text Pin
belzu13-Oct-05 1:12
belzu13-Oct-05 1:12 
GeneralProblems with Message Tip Pin
Terrel7-Aug-05 7:35
Terrel7-Aug-05 7:35 
GeneralMessageBalloon Problems Pin
Choudhry2-Jan-05 21:59
Choudhry2-Jan-05 21:59 
GeneralBalloon Tips with ListView control Pin
mistert00620-Oct-04 9:07
mistert00620-Oct-04 9:07 
GeneralNot able to open the Project Pin
karthikwaits4u18-Oct-04 1:56
karthikwaits4u18-Oct-04 1:56 
GeneralError while attaching to combo boxes Pin
cdengler3-Sep-04 14:35
cdengler3-Sep-04 14:35 
GeneralRe: Error while attaching to combo boxes Pin
legoman30-Sep-04 3:35
legoman30-Sep-04 3:35 
GeneralClose works in C# project, but not VB. Pin
CybrCyfr22-Aug-04 13:39
CybrCyfr22-Aug-04 13:39 
GeneralRe: Close works in C# project, but not VB. Pin
CybrCyfr22-Aug-04 15:44
CybrCyfr22-Aug-04 15:44 
GeneralHoverBalloon will never reappear Pin
Keia10-Dec-03 22:34
professionalKeia10-Dec-03 22:34 
GeneralRe: HoverBalloon will never reappear Pin
bromankode1-Mar-05 6:16
bromankode1-Mar-05 6:16 
GeneralSmall change suggested Pin
Matchpoint12-Nov-03 4:43
Matchpoint12-Nov-03 4:43 
GeneralRe: Small change suggested Pin
rockmover23-Nov-05 6:46
rockmover23-Nov-05 6:46 

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

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