5,699,997 members and growing! (20,005 online)
Email Password   helpLost your password?
Languages » C / C++ Language » General     Intermediate License: The Code Project Open License (CPOL)

An Office 2003-like popup notifier

By Nicolas Wälti

A nice little control to help the user notice you're trying to tell him something...
VB, Windows, .NET 2.0, .NET, WinForms, GDI+, Visual Studio, VS2005, Dev

Posted: 23 Mar 2006
Updated: 23 Mar 2006
Views: 90,844
Bookmarked: 140 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
51 votes for this Article.
Popularity: 7.73 Rating: 4.53 out of 5
1 vote, 2.0%
1
0 votes, 0.0%
2
1 vote, 2.0%
3
9 votes, 17.6%
4
40 votes, 78.4%
5

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



Occupation: Software Developer (Senior)
Location: Switzerland Switzerland

Other popular C / C++ Language articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 25 of 103 (Total in Forum: 103) (Refresh)FirstPrevNext
GeneralUnable to close the popup with the close button!!!memberharvindersingh1154:04 1 Oct '08  
QuestionHow to use this in a project C#memberharvindersingh1154:22 29 Sep '08  
AnswerRe: How to use this in a project C#memberharvindersingh1155:03 1 Oct '08  
GeneralExcellent Work...........memberMember 40173817:14 19 Aug '08  
GeneralFrom right to left ordermemberammsamm1:40 22 Oct '07  
GeneralNew version anyonememberNick Waelti0:21 26 Aug '07  
GeneralRe: New version anyone - I'd be gladmembersemmel719:04 10 Oct '07  
GeneralRe: New version anyonememberMember 13153207:22 23 Dec '07  
JokeRe: New version anyonemembergaryjohn_20007:06 31 Dec '07  
NewsUnused Codememberpablleaf13:07 21 Jun '07  
NewsRedundant Line of Codememberpablleaf11:38 21 Jun '07  
GeneralSmall DoubtmemberGayuDams3:05 26 Apr '07  
GeneralOpacity Problem with multiple stacking popupsmemberfperugini11:18 22 Mar '07  
AnswerRe: Opacity Problem with multiple stacking popupsmemberfperugini5:33 23 Mar '07  
QuestionRe: Opacity Problem with multiple stacking popupsmemberStyxke21:27 5 Apr '07  
AnswerRe: Opacity Problem with multiple stacking popupsmemberfperugini8:16 13 Apr '07  
GeneralMultiple Highlight Linesmemberb00tleg10:38 22 Mar '07  
AnswerRe: Multiple Highlight LinesmemberNick Waelti23:34 22 Mar '07  
GeneralRe: Multiple Highlight Linesmemberb00tleg8:04 23 Mar '07  
GeneralRe: Multiple Highlight LinesmemberHoney Arora20:29 23 May '07  
GeneralC# versionmemberAmbili_T23:23 21 Mar '07  
AnswerRe: C# versionmemberLittleWhiteDog22:33 22 Mar '07  
QuestionHowto move the popup with the grip?memberLittleWhiteDog6:32 14 Mar '07  
AnswerRe: Howto move the popup with the grip?memberNick Waelti3:42 15 Mar '07  
QuestionRe: Howto move the popup with the grip? [modified]memberLittleWhiteDog6:20 21 Mar '07  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 23 Mar 2006
Editor: Smitha Vijayan
Copyright 2006 by Nicolas Wälti
Everything else Copyright © CodeProject, 1999-2008
Web09 | Advertise on the Code Project