How to create a Notification Popup Alert in window form application.
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:
- 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
Design Your form according to your requirement
Code Behind Buttons
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
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.