Skip to main content
Email Password   helpLost your password?

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.

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
Generalensure message balloon dies when window changes or closes Pin
BobishKindaGuy
12:53 9 Apr '09  
AnswerRe: ensure message balloon dies when window changes or closes [modified] Pin
KPEBEDKO
23:23 13 Aug '09  
GeneralHoverBalloon disappears rather quickly Pin
BobishKindaGuy
1:37 4 Jan '09  
GeneralRe: HoverBalloon disappears rather quickly Pin
sgennette
9:54 9 Apr '09  
GeneralRe: HoverBalloon disappears rather quickly [modified] Pin
BobishKindaGuy
11:48 9 Apr '09  
GeneralRe: HoverBalloon disappears rather quickly Pin
sgennette
4:06 10 Apr '09  
GeneralRe: HoverBalloon disappears rather quickly Pin
BobishKindaGuy
10:15 10 Apr '09  
GeneralBalloonTip Visual Stype & WPF Pin
RStern
1:15 26 Aug '08  
QuestionHow to do it for richtextbox? Pin
Priyank Bolia
10:29 10 Apr '08  
GeneralHelp with edit tooltip Pin
rageit
20:22 15 Jul '07  
GeneralEdit ToolTip Appears and dissapears Pin
Carl Ja
14:52 23 May '07  
GeneralRe: Edit ToolTip Appears and dissapears Pin
Carl Ja
17:28 23 May '07  
GeneralHOW TO ADD CUSTOM ICON Pin
Nicola Costantini
7:10 12 Mar '07  
QuestionMissing feature? Pin
petemaverick
9:29 11 Feb '07  
Generalballoon becomes orphan Pin
Harm Salomons
8:38 25 Oct '06  
GeneralTimeout option Pin
kikhan_21
5:42 15 Jun '06  
AnswerRe: Timeout option Pin
JesusAbizanda
1:35 23 Jun '06  
GeneralRe: Timeout option Pin
sgennette
9:53 9 Apr '09  
Questionproblem with OpenFIleDialog, SaveFileDialog and FolderBrowseDialog Pin
kikhan_21
4:07 31 May '06  
AnswerRe: problem with OpenFIleDialog, SaveFileDialog and FolderBrowseDialog Pin
marantz
0:45 11 Jul '07  
GeneralDirectly copied from MSDN bugs and all Pin
Mach005
14:32 12 May '06  
GeneralRe: Directly copied from MSDN bugs and all Pin
ramshri
12:36 13 May '06  
GeneralAccessViolationException: Bug in FMSEditTip.cs Pin
Mach005
14:11 10 May '06  
GeneralRe: AccessViolationException: Bug in FMSEditTip.cs Pin
jose.mira
4:44 1 Oct '08  
GeneralHow can the EditBallon be hidden? Pin
Kelraad
3:53 14 Feb '06  


Last Updated 14 Sep 2003 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009