How to create a Notification Popup Alert in window form application.

Spread the love

How to create a Notification Popup in window form application.

In this video we will see how to create a Popup Notification form in C# Windows form application in visual studio .The obvious reason for creating an alert is to show an informational message to the user. This is especially useful if you want to show a Success , Info, Error or Warning message to the user.

Tools Required:

  1. Visual Studio 2012 or later.

Steps to create Popup Notification Form

Open Visual Studio and create a new windows form Application in Visual C#.

Go to Solution Explorer, right-click the project file and click Manage Nuget Packages

search Notification Window  and install  Tulpep.NotificationWindow

Tulpep.NotificationWindow

Design Your form according to your requirement

view
success
infoPopup
warningPopup
errorPopup

Code Behind Buttons


   private void buttonsuccess_Click(object sender, EventArgs e)
        {
            PopupNotifier popup = new PopupNotifier();
            popup.Image = Properties.Resources.success;
            popup.BodyColor = Color.FromArgb(40, 167, 69);
            popup.TitleText = "Success";
            popup.TitleColor = Color.White;
            popup.TitleFont = new Font("Century Gothic", 15, FontStyle.Bold);

            popup.ContentText = "Your Success Message";
            popup.ContentColor = Color.White;
            popup.ContentFont = new Font("Century Gothic",12);
            popup.Popup();
        }

        private void buttoninfo_Click(object sender, EventArgs e)
        {

            PopupNotifier popup = new PopupNotifier();
            popup.Image = Properties.Resources.success;
            popup.BodyColor = Color.FromArgb(23, 162, 184);
            popup.TitleText = "Info ";
            popup.TitleColor = Color.White;
            popup.TitleFont = new Font("Century Gothic", 15, FontStyle.Bold);

            popup.ContentText = "Your Info Message";
            popup.ContentColor = Color.White;
            popup.ContentFont = new Font("Century Gothic", 12);
            popup.Popup();
        }
       
        private void buttonwarning_Click(object sender, EventArgs e)
        {
            PopupNotifier popup = new PopupNotifier();
            popup.Image = Properties.Resources.success;
            popup.BodyColor = Color.FromArgb(255, 193, 7);
            popup.TitleText = "Warning !!";
            popup.TitleColor = Color.White;
            popup.TitleFont = new Font("Century Gothic", 15, FontStyle.Bold);

            popup.ContentText = "Your Warning Message";
            popup.ContentColor = Color.White;
            popup.ContentFont = new Font("Century Gothic", 12);
            popup.Popup();
        }

        private void buttonerror_Click(object sender, EventArgs e)
        {

            PopupNotifier popup = new PopupNotifier();
            popup.Image = Properties.Resources.success;
            popup.BodyColor = Color.FromArgb(220, 53, 69);
            popup.TitleText = "Error ";
            popup.TitleColor = Color.White;
            popup.TitleFont = new Font("Century Gothic", 15, FontStyle.Bold);

            popup.ContentText = "Your Error Message";
            popup.ContentColor = Color.White;
            popup.ContentFont = new Font("Century Gothic", 12);
            popup.Popup();
        }

Video Tutorial:

Watch a full video to learn how to create popup notification in windows form application

Source Code:

Thank you for reading this article. Leave a comment  if you have any question about this article. Please don’t forget to subscribe our official YouTube Channel RashiCode for more information.

Leave a Reply

Your email address will not be published.