Toastr.Winforms is a lightweight and customizable toast notification library for Windows Forms applications. It provides an easy way to display success, error, and warning messages in a visually appealing and non-intrusive manner.
- Toast Positioning: Choose from predefined positions (TopLeft, TopRight, TopCenter, BottomLeft, BottomRight, BottomCenter) for displaying toast notifications.
- Customizable Duration: Set a custom duration for how long the toast notification should be displayed.
- Success, Error, and Warning Notifications: Easily show success, error, and warning messages with built-in icons and colors.
To use Toastr.Winforms in your Windows Forms project, follow these steps:
- Download the Toastr.Winforms package from NuGet.
- Install the package using the NuGet Package Manager Console or the Package Manager UI.
using Toastr.Winforms;
// Create a new toast notification
// Note: In version 6.1.0, 'enableSoundEffect' has been added to the constructor parameters.
var toast = new Toast(ToastrPosition.TopRight, duration: 3000, enableSoundEffect: true);
// Or you can use defaults: var toast = new Toast();
// Show a success notification
toast.ShowSuccess("Operation successful!");
// Show an error notification
toast.ShowError("An error occurred.");
// Show a warning notification
toast.ShowWarning("This is a warning message.");
// The toast notification will automatically close after the specified duration.