Click here to Skip to main content
Licence CPOL
First Posted 23 Mar 2006
Views 154,833
Downloads 1,594
Bookmarked 172 times

An Office 2003-like popup notifier

By Nicolas Wälti | 23 Mar 2006
A nice little control to help the user notice you're trying to tell him something...
1 vote, 1.9%
1

2
1 vote, 1.9%
3
10 votes, 19.2%
4
40 votes, 76.9%
5
4.77/5 - 52 votes
2 removed
μ 4.52, σa 1.23 [?]

Introduction

This is a simple project, a control that mimics the Microsoft® Outlook® 2003 mail alert.

Features

This control has several features. Among them, you'll find:

Progressive appearance - transparency

MSN Messenger like pop-ups (any size, color, etc.)

Another sample

This control is 100% drawn in the code, there is absolutely no other dependencies than System.Drawing and System.Windows.Forms.

You can include a ContextMenuStrip when clicking on the "down arrow" button.

Using the code

The controls is made of two basic classes:

  • A form (the part that will actually show up).
  • A class that contains all the properties that will be includable on forms.

The class contains two timers, one used for the appearing/disappearing animation, the other (configurable) is used to define how much time the popup is shown before it disappears.

This is how the form is actually shown:

fPopup.Size = Size
fPopup.Opacity = 0
fPopup.Location = _
  New Point(Screen.PrimaryScreen.WorkingArea.Right_
   - fPopup.Size.Width - 1, _
   Screen.PrimaryScreen.WorkingArea.Bottom)
fPopup.Show()

The form is does the drawing in the Paint event.

I'm using these functions to obtain a color that is similar but lighter/darker. There might exist another method.

Private Function GetDarkerColor(ByVal Color As Color) As Color
    Dim clNew As Color
    clNew = Drawing.Color.FromArgb(255, DedValueMin0(CInt(Color.R), _
            Parent.GradientPower), DedValueMin0(CInt(Color.G), _
            Parent.GradientPower), DedValueMin0(CInt(Color.B), _
            Parent.GradientPower))
    Return clNew
End Function

And to avoid flickering...

Me.SetStyle(ControlStyles.OptimizedDoubleBuffer, True)
Me.SetStyle(ControlStyles.ResizeRedraw, True)
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)

Points of Interest

None really, it's nice, it's fun, it's colorful... that's it :)

History

  • March 2006 - V 1.0.

License

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

About the Author

Nicolas Wälti

Software Developer (Senior)

Switzerland Switzerland

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
NewsNew Version of this Control with many Bugs fixed (Link inside) PinmemberSimon B.5:54 3 Nov '11  
Questioncontrols property Pinmembersergio585:08 22 Jul '11  
GeneralShowing multiple popups at the same time. Pinmemberkdlc8:56 19 Jan '09  
GeneralUnable to close the popup with the close button!!! Pinmemberharvindersingh1154:04 1 Oct '08  
GeneralRe: Unable to close the popup with the close button!!! Pinmemberedzjx9:49 13 Feb '10  
GeneralRe: Unable to close the popup with the close button!!! Pinmemberjamslove5:29 16 Aug '10  
GeneralRe: Unable to close the popup with the close button!!! Pinmembernikoskritikos6:47 30 Aug '10  
QuestionHow to use this in a project C# Pinmemberharvindersingh1154:22 29 Sep '08  
AnswerRe: How to use this in a project C# Pinmemberharvindersingh1155:03 1 Oct '08  
GeneralRe: How to use this in a project C# Pinmemberlasai16:48 27 Jan '10  
GeneralExcellent Work........... PinmemberMember 40173817:14 19 Aug '08  
GeneralFrom right to left order Pinmemberammsamm1:40 22 Oct '07  
GeneralNew version anyone PinmemberNick Waelti0:21 26 Aug '07  
GeneralRe: New version anyone - I'd be glad Pinmembersemmel719:04 10 Oct '07  
GeneralRe: New version anyone PinmemberMember 13153207:22 23 Dec '07  
JokeRe: New version anyone Pinmembergaryjohn_20007:06 31 Dec '07  
NewsUnused Code Pinmemberpablleaf13:07 21 Jun '07  
NewsRedundant Line of Code Pinmemberpablleaf11:38 21 Jun '07  
GeneralSmall Doubt PinmemberGayuDams3:05 26 Apr '07  
GeneralOpacity Problem with multiple stacking popups Pinmemberfperugini11:18 22 Mar '07  
AnswerRe: Opacity Problem with multiple stacking popups Pinmemberfperugini5:33 23 Mar '07  
QuestionRe: Opacity Problem with multiple stacking popups PinmemberStyxke21:27 5 Apr '07  
AnswerRe: Opacity Problem with multiple stacking popups Pinmemberfperugini8:16 13 Apr '07  
GeneralMultiple Highlight Lines Pinmemberb00tleg10:38 22 Mar '07  
AnswerRe: Multiple Highlight Lines PinmemberNick Waelti23:34 22 Mar '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web02 | 2.5.120210.1 | Last Updated 23 Mar 2006
Article Copyright 2006 by Nicolas Wälti
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid