An old project I found, Notification is a flexible, easy to use notification assistant for your WinForms project. This can be compiled as a dll.
*Gif is choppy - animation uses native APIs and is super smooth IRL*The project includes a test form with customizable fields demonstrating its use. Basically, this is all you need:
var notification = new Notification(Style.Slide, 250, Direction.Left)
{
Title = "Hello World",
Body = "Your body",
TitleColor = Color.Black,
ForeColor = Color.Black,
BackColor = Color.White,
ScreenPadding = 10,
Icon = new Icon()
{
Image = Image.FromFile(@".."),
Padding = 5,
BackColor = Color.LightGray
}
};
notification.Show();
Forcing dismissal is possible with notification.Dismiss()
, you can choose to play out the exit animation or have it perish instantaneously through the bool param instant
.
Method show()
supports an overload with an int param where the notification's lifespan can be marked. Hovering over the notification will suspend the countdown to EOL. e.g.
var notification = ...;
notification.Show(3000); // displays for 3s/3000ms
The notification control itself inherits from System.Windows.Forms.Form and exposes all properties alongside. You can attach handlers, configure dimensions, etc. as normal.
MIT