Giter Site home page Giter Site logo

notification-popup-window's Introduction

Notification Popup Window Nuget Build status

A notification window that appears on the lower right part of the screen for .NET

Screenshot

This project is based on a Notification Window created in 2011 by Simon Baer. It is also base in Office 2003-like popup notifier created in 2006 by Nicolas Wälti.

Features:

  • 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
  • Sptionally display a close button
  • Optionally display a button which opens a context menu
  • Supports right to left languages like Persian and Arabic

Screenshot

How to use it

You can install the lastest version using NuGet

Install-Package Tulpep.NotificationWindow

And use it this way:

var popupNotifier = new PopupNotifier();
popupNotifier.TitleText = "Title of popup";
popupNotifier.ContentText  = "Content text";
popupNotifier.IsRightToLeft = false;
popupNotifier.Popup();

This repository contains a Visual Studio Test Project if you want a working example.

notification-popup-window's People

Contributors

cereal-killa avatar hamid67fathi avatar liorbanai avatar ricardopolo avatar rykkan avatar zy26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notification-popup-window's Issues

Multiple Notification Support

Is there any support for multiple notifications, e.g., if there are 3 notifications, can they be stacked vertically one on top of the other?

Popup shows on Display #1 always

In multiple display situations, the popup always shows on the display windows considers the main display from Display Properties, Identify Displays.

If the app is running on another monitor, the popup may not seen (or is likely to be missed).

Any chance you could modify the popup method to detect which display the app is running on to ensure its shown on the same monitor as the app?

Close popup from another winfow form

I have a question. I have a project using winforms, I had a mainform and another form. When i call popup in main form, i can clicked close button on popup. But after i open another form by using ShowDialog from Mainform, and call popup show then i can not close popup. Can you give me a solution to do it !

I randomly get this error when the notification is triggered.

System.ArgumentException: The parameter is invalid.
en System.Drawing.Image.get_RawFormat()
en System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
en Tulpep.NotificationWindow.PopupNotifierForm.PopupNotifierForm_Paint(Object sender, PaintEventArgs e)
en System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
en System.Windows.Forms.Form.OnPaint(PaintEventArgs e)
en System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
en System.Windows.Forms.Control.WmPaint(Message& m)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
en System.Windows.Forms.Form.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

My code:

PopupNotifier popup = new PopupNotifier();
popup.Image = Properties.Resources.western_union_logo;
popup.ImagePadding = new Padding(10);
popup.ImageSize = new Size(75, 75);
popup.BodyColor = Color.LightGray;
popup.TitleText = title;
popup.TitleColor = Color.Black;
popup.TitleFont = new Font("Century Gothic", 15, FontStyle.Bold);
popup.ContentText = bodyText;
popup.ContentColor = Color.Black;
popup.ContentFont = new Font("Century Gothic", 12);
popup.Click += new EventHandler(this.popup_Click);
popup.Popup();

How hide gently while appearing

I'm looking for a way to hide gently the popup while opening ...
Please help me

    public void HideNow()
    {
        tmrWait.Stop();
        isAppearing = false;

        tmrWait.Interval = Delay;

        realAnimationDuration = 1;

        tmrAnimation.Interval = AnimationInterval;
        tmrAnimation.Start();
        sw.Restart();
    }

Sorry for my bad english.

Popup not showing

Added the sample code provided and the popup doesn't show up:

                    var popupNotifier = new PopupNotifier()
                    {
                        TitleText = "Title of popup",
                        ContentText = "Content text",
                    };
                    popupNotifier.Popup();

How to anchor PopupNotifier

Hi,

is there a way how to anchor PopupNotifier to form instead of a screen?
I tried to set location to active form. But it is not anchored to form.

Thanks for answer.

status of repository

Hi @ricardopolo ,
Since my repo is more updated (multiple notifications, auto resizing, Sounds, .net core support) maybe it good idea to add to the readme note for those visitors how would like to use them but unfamiliar with it..

Just and idea :)

PopupNotifier object does not dispose

When I call the dispose method on PopupNotifier Object and observe the debugger, the object seems to be not disposed as the Process Memory does not show any decrease in size.

Here's what i done:

        public void ShowPopup()
        {
            popup = new PopupNotifier
            {
                TitleText = "Popup Test",
                ContentText = "Barcode generation success !",
                ShowOptionsButton = true,
                ShowGrip = false,
            };

            popup.Disappear += OnPopupDisappear;
            popup.Close += OnPopupClose;
            popup.Popup();
        }

        private void OnPopupClose(object sender, EventArgs e)
        {
            popup.Dispose();
        }

        private void OnPopupDisappear(object sender, EventArgs e)
        {
            popup.Dispose();
        }

Popup not appearing

I create a new PopupNotifier, assign a TitleText and a ContentText. I call the Popup method, but nothing is showing on the screen. I have also assigned a handler to the Appear event which does fire, but I see no notification on the screen.

using Tulpep.NotificationWindow;

namespace DrakeAccountingScheduler
{
    public static class Notifier
    {
        private static PopupNotifier Notification;

        static Notifier()
        {
            // Use this to dress up our notifier as we wish
        }

        public static void Notify(string title, string message)
        {
            Notification = new PopupNotifier {TitleText = title, ContentText = message};
            Notification.Appear += Notification_Appear;
            Notification.Popup();
        }

        private static void Notification_Appear(object sender, System.EventArgs e)
        {
            
        }
    }
}

onClick behaviours

i wish it would be possible (onClick) to:

  1. launch another function after that (i have an browser.Reload(); function relating to CefSharp)
  2. bring my form1 in front and focus it (its usualy in the background or minimized somewhere)
  3. close the notification window on that same click.

is it? - if yes.. please tell me how.

How to detect PopUp Showing?

Hey how can i detect popup is showing now? Or can i restrict for only one popup object show at the same time?

Thank you..

Feature: Message notification with sound

Feature: Message notification with sound

hello..can 
Feature: Message notification with sound ?

Thank u Very Much.....
 SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\chimes.wav");
    simpleSound.Play();

Scroll

the scrolling option doesn't work when I set it to true , I can't see the text when I scroll in the notif cause I have many rows in it, can you please fix this or is there something I can do about it ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.