Click here to Skip to main content
15,860,859 members
Articles / Programming Languages / C#

Notification Window

Rate me:
Please Sign up or sign in to vote.
4.40/5 (49 votes)
3 Nov 2011CPOL1 min read 200.9K   32.2K   120   66
A notification window that appears on the lower right part of the screen.

Introduction

This is a WinForms component that displays a notification window in the lower right part of the screen. Just like the Outlook new mail notification. There are many possibilities to customize the appearance of the notification window:

  • scroll and/or fade window in and out
  • configure the animation speed and the time the window is displayed
  • display a custom icon
  • set title and content text, font, size, and color
  • set all paddings around icon, title and content
  • optionally display a close button
  • optionally display a button which opens a context menu

Background

This control is based on the CodeProject article An Office 2003-like popup notifier by Nicolas Wälti. I fixed a lot of bugs in the original control and added even more properties for customizing the appearance of the notification window.

Using the code

Using the notification window component is very simple. Just add a reference to "NotificationWindow.dll" to your WinForms project. A new component " will appear in the toolbox. Then drag this component to an existing form.

To show the notification, simply call the "Popup" method. However, normally you want to set some properties first to customize the appearance of the notification window.

C#
popupNotifier1.TitleText = "This is the notification title";
popupNotifier1.ContentText = "This is the notification text";
popupNotifier1.Popup();

Take a look at the demo project which shows the usage of most properties!

History

  • 2011-11-02: v1 released.

License

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


Written By
Software Developer Sevitec Informatik AG
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
adrianburns23-Jan-12 2:37
adrianburns23-Jan-12 2:37 
QuestionVery nice ! Pin
Wrangly16-Jan-12 10:00
Wrangly16-Jan-12 10:00 
GeneralMy vote of 5 Pin
Thornik7-Nov-11 21:25
Thornik7-Nov-11 21:25 
QuestionIt Can't MultiplePop? Pin
bbls19833-Nov-11 21:28
bbls19833-Nov-11 21:28 
GeneralRe: It Can't MultiplePop? Pin
Member 35263175-Jan-12 8:25
Member 35263175-Jan-12 8:25 
QuestionIt's not quite finished... Pin
Bill SerGio, The Infomercial King3-Nov-11 19:42
Bill SerGio, The Infomercial King3-Nov-11 19:42 
QuestionNice, but one essential point missing Pin
mav.northwind3-Nov-11 11:37
mav.northwind3-Nov-11 11:37 
AnswerRe: Nice, but one essential point missing Pin
nickeex29-Oct-12 1:21
nickeex29-Oct-12 1:21 
This is easy to fix. Go to the form class and override the bool and then recompile it, should work after that! Source: http://stackoverflow.com/questions/156046/show-a-form-without-stealing-focus[^]

C#
protected override bool ShowWithoutActivation
{
  get { return true; }
}

GeneralRe: Nice, but one essential point missing Pin
mav.northwind15-Nov-12 18:52
mav.northwind15-Nov-12 18:52 
GeneralRe: Nice, but one essential point missing Pin
RenniePet9-Aug-14 4:20
RenniePet9-Aug-14 4:20 
GeneralRe: Nice, but one essential point missing Pin
Member 13372-Jun-15 6:22
Member 13372-Jun-15 6:22 
GeneralMy vote of 5 Pin
Wooters3-Nov-11 7:29
Wooters3-Nov-11 7:29 
QuestionGreat Work Pin
Abinash Bishoyi3-Nov-11 6:31
Abinash Bishoyi3-Nov-11 6:31 
AnswerRe: Great Work Pin
senbadamodaran25-Jan-13 0:26
senbadamodaran25-Jan-13 0:26 

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.