Click here to Skip to main content
13,731,209 members
Click here to Skip to main content
Add your own
alternative version


100 bookmarked
Posted 6 Jun 2005
Licenced CPOL

GmailNotifierControl: A Gmail Notifier like control

, 6 Jun 2005
Rate this:
Please Sign up or sign in to vote.
A Gmail Notifier dialog control, to use with any app, just like a baloon tooltip.

Sample Image - GmailNotifierInfo.jpg


I've been using Gmail for something like 8 months, and all I can say is that the Gmail team did a good work. I also liked the Gmail Notifier, the way it acts... I decided thus to create my own Gmail Notifier like control, so as to use it in apps I write.

Using the code

The GmailNotifierControl is made of a picture box, a label, one or two timers (I could have used only one but the code wouldn't have been that clear) and a [ThatsItControl :)]. The control exposes some properties visible under the Misc... section in the VS IDE, and a method, all of which are listed below:

  • GmailImage: The image to show in the control.
  • Info: The text to display.
  • Interval: The time to sleep before moving the control up or down.
  • NotifyText: The text to display in the notify icon of the control.
  • Pitch: The number of pixels by which the control is moved vertically (in the Y axis).
  • TimeOut: The duration of visibility of the info, after that duration the control hides.
  • ShowInfo(): Shows the info set in the control.

The code itself is easy to understand, just see by yourself:

private void tmrMove_Tick(object sender, System.EventArgs e)
    int nTaskBarHeight = Screen.PrimaryScreen.Bounds.Bottom - 
    if(!bHide) //Show the Info Box
        if ( this.Top > Screen.PrimaryScreen.Bounds.Bottom - 
           (this.Height + nTaskBarHeight )) //screen limit - TaskBarSize
            this.TopMost = false;
            this.Top -= nPitch;
            bFinished = false;
            this.TopMost = true;
            bFinished = true;
            bHide = true;
    else if (!bFinished) //Hide It
        if ( this.Top < Screen.PrimaryScreen.Bounds.Bottom )
            this.TopMost = false;
            this.Top += nPitch;
            bFinished = false;
            this.TopMost = true;
            bFinished = true;
            bHide = false;
    if (bFinished)
    if (bHide && bFinished)

In order to have the properties in the same category in the IDE, I used this:

 Description("The TimeOut in milliseconds of GmailNotifierControl Info")]
 public int TimeOut
     return this.nTimeOut / 1000;
     this.nTimeOut = value * 1000;
     this.tmrEnd.Interval = value * 1000;

  Description("The text to show in the GmailNotifierControl")]
 public string Info
     return this.strInfo;
     this.lblInfo.Text = value;
     this.strInfo = value;

Points of Interest

I have tried to override some form specific properties like opacity, just to get them together in the Misc... category but couldn't. I would also like to refine this control, so any contribution, any suggestions, would be welcome.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Chief Technology Officer
Morocco Morocco
in his studies, erratum discovered c/c++.he appreciated it.
when he met oracle products, in his job, he fell in love.
he uses c# .net & ms sql.

he created a "f.r.i.e.n.d.s" like soap movie, melting all of the above.
went back in the university.
after he took courses of artificial vision & imagery, he finished his studies with a successful license plate recognition project.

You may also be interested in...


Comments and Discussions

GeneralGet the taskbar height Pin
Kerem Kat3-Sep-07 9:06
memberKerem Kat3-Sep-07 9:06 
AnswerRe: Get the taskbar height Pin
eRRaTuM4-Sep-07 6:49
membereRRaTuM4-Sep-07 6:49 
GeneralRe: Get the taskbar height Pin
Kerem Kat4-Sep-07 8:13
memberKerem Kat4-Sep-07 8:13 
GeneralRe: Get the taskbar height Pin
eRRaTuM10-Sep-07 4:45
membereRRaTuM10-Sep-07 4:45 
GeneralThanks and small addition Pin
PeterTa15-Feb-07 18:27
memberPeterTa15-Feb-07 18:27 
AnswerRe: Thanks and small addition Pin
eRRaTuM18-Feb-07 23:49
membereRRaTuM18-Feb-07 23:49 
QuestionGood Work! Pin
Mike20025-Aug-06 1:30
memberMike20025-Aug-06 1:30 
AnswerRe: Good Work! Pin
eRRaTuM21-Nov-06 23:53
membereRRaTuM21-Nov-06 23:53 
I was on a very long vacations, so excuse the TimeOut Smile | :)
I guess that this is very interesting and very possible too : use string[] strinInfoZ instead of using the private string strInfo who contains the message, a timer who would trigger ShowInfo(int index) to show the next message from strinInfoZ instead of ShowInfo().
Concerning the LinkLabel, Big Grin | :-D Yesss!!! I think that it would be very usefull, if the GmailNotifierControl is meant to be called in a TaskScheduler or a FileSystemWatcher Like App, or ^_^ any other application.

:: YOU make history ::

GeneralThanks a lot. Pin
AngurajanK19-Jul-06 23:50
memberAngurajanK19-Jul-06 23:50 
AnswerRe: Thanks a lot. Pin
eRRaTuM20-Jul-06 1:01
membereRRaTuM20-Jul-06 1:01 
QuestionUse at commercial product? Pin
sanme9813-Jun-06 22:24
membersanme9813-Jun-06 22:24 
AnswerRe: Use at commercial product? Pin
eRRaTuM28-Jun-06 1:39
membereRRaTuM28-Jun-06 1:39 
GeneralRe: Use at commercial product? Pin
Xavierkeil23-Aug-08 11:04
memberXavierkeil23-Aug-08 11:04 
GeneralRe: Use at commercial product? Pin
eRRaTuM25-Aug-08 4:37
membereRRaTuM25-Aug-08 4:37 
GeneralOpacity Pin
mishariy19-Oct-05 6:06
membermishariy19-Oct-05 6:06 
GeneralRe: Opacity Pin
eRRaTuM27-Oct-05 1:35
membereRRaTuM27-Oct-05 1:35 
GeneralWider menu bars Pin
Phebous16-Jun-05 8:43
memberPhebous16-Jun-05 8:43 
GeneralRe: Wider menu bars Pin
eRRaTuM17-Jun-05 6:09
membereRRaTuM17-Jun-05 6:09 
QuestionDoes it miss something? Pin
eRRaTuM8-Jun-05 4:55
membereRRaTuM8-Jun-05 4:55 
Generallittle change Pin
TylorDurden6-Jun-05 22:24
memberTylorDurden6-Jun-05 22:24 
GeneralRe: little change Pin
eRRaTuM7-Jun-05 0:11
membereRRaTuM7-Jun-05 0:11 

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.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01-2016 | 2.8.180920.1 | Last Updated 6 Jun 2005
Article Copyright 2005 by eRRaTuM
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid