65.9K
CodeProject is changing. Read more.
Home

Balloon tooltips UserControl in VB.NET

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.52/5 (13 votes)

Apr 11, 2005

viewsIcon

62450

downloadIcon

976

How to create balloon tooltips using graphic paths to highlight someting on your form.

Sample screenshot

Introduction

This is a simple application that I created while I was working on one of my other applications. It might not be exactly what you are looking for but it does what I wanted to achieve. On top of that this is my first submission to CP, a great source of information.

All this application does is allows you to create balloon tips like in the image above to highlight any area of your form/application.

Technique:

Inside control:

This simple user control utilizes the GDI+ polygon:

Dim p As Point() = {New Point(0, 0), New Point(100, 0), _
         New Point(100, 50), New Point(170, 120), _
         New Point(70, 50), New Point(0, 50)}

mpath.AddPolygon(p)

Using the control:

In your client application, remember to add a control reference in you tool box to BaloonToolTip.dll.

Then simply drag and drop the control on your form to use it.

BaloonToolTip2.BackColor = Color.Red

BaloonToolTip2.ForeColor = Color.Yellow

BaloonToolTip2.ShowBaloonToolTip("Hello Tip going left", _
                         btnShow.Left, btnShow.Top, False)

The last parameter PointingRight is a Boolean type. If set to True, the control would move the balloon towards left and the pointer would move towards right and vice versa.

In the sample, Xpos and YPos are taken from btnShow's Left and Top respectively.

Enjoy!!!