Click here to Skip to main content
14,036,655 members
Click here to Skip to main content
Add your own
alternative version

Stats

9.1K views
1.3K downloads
27 bookmarked
Posted 1 Aug 2016
Licenced LGPL3

Charm Notification Component

, 2 Aug 2016
Rate this:
Please Sign up or sign in to vote.
Gorgeous notification component for creating advanced notifications

This GIF is lagging, for better viewing I suggest you to check the Demo application.

Introduction

The CharmNotification is a component that allows you to create customized notifications that slide from the right to the left side of the bottom-right side of the screen.

Thanks to this component you'll be able to customize the colors,icon...etc of your notification or you can simply create new ones at the Run-Time (as presented above).

Background

While coding or reading books notifications like this (updates) appear in an attractive way with a cute tone, so I asked myself : 

Why don't I create a free component that does the same thing?

Implementation

This component contains several properties, here I present them all and their functionalities : 

  • BackColor1 ; The color of the left side of the notification.
  • BackColor2 ; The color of the right side of the notification.
  • Title ; The title of the notification.
  • Text ; The text of the notification.
  • TitleForeColor ; The color of title of the notification.
  • TextForeColor ; The color of title of the notification
  • Icon ; The icon the notification.
  • Duration ; The duration of the notification (1000 = 1 second).
  • PlayTone ; The notification will play a tone if this bool will be set true.

Layout

Using the code

CharmNotification usage is made to be as easy as possible, however, you can manipulate it with codes or using the designer.

To fulfill the tast and release your advanced notification you can go through one the two possible methodologies : 

  • Easy usage
  1. Drag and drop the component on the form
  2. Edit the properties : 
  3. write this piece of code :
  4. notification1.ShowNotification();
  • Run-Time usage

To create a customized notification you can write this piece of code :

Notification n = new Notification();
 n.Title = "Windows update";
 n.Text = "Windows started updating, please do not turn off you computer.";
 n.Duration = 3000;
 n.Icon = Properties.Resources.windows_32;
 n.BackColor2 = Color.FromArgb(35,35,35);
 n.BackColor1 = Color.FromArgb(28, 28, 28);
 n.TitleForeColor = Color.WhiteSmoke;
 n.TextForeColor = Color.WhiteSmoke;
 n.ShowNotification();

Result : 

 

That's all of it folks ! 
 

 

 

Points of Interest

Sometimes you must relay on the simplest stuff to create the most complicated things.

History

8/2/2016 : First release.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

Share

About the Author

Alaa Ben Fatma
Student
Tunisia Tunisia
I am a 19 years old software developer & a university student. I am a curious person, I love learning about new things and meeting more experienced developers & engineers.
alaabenfatma[a]yahoo.fr

You may also be interested in...

Comments and Discussions

 
QuestionSweet Pin
jediYL16-Aug-16 17:27
professionaljediYL16-Aug-16 17:27 
GeneralMy vote of 5 Pin
Franc Morales2-Aug-16 11:43
memberFranc Morales2-Aug-16 11:43 
SuggestionMulti-Monitor Configuration Pin
GAAlex1-Aug-16 20:47
memberGAAlex1-Aug-16 20:47 
GeneralRe: Multi-Monitor Configuration Pin
RadiatorTwo1-Aug-16 22:35
memberRadiatorTwo1-Aug-16 22:35 

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
Web03 | 2.8.190424.1 | Last Updated 2 Aug 2016
Article Copyright 2016 by Alaa Ben Fatma
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid