ModernNotify 1.0.0
See the version list below for details.
dotnet add package ModernNotify --version 1.0.0
NuGet\Install-Package ModernNotify -Version 1.0.0
<PackageReference Include="ModernNotify" Version="1.0.0" />
<PackageVersion Include="ModernNotify" Version="1.0.0" />
<PackageReference Include="ModernNotify" />
paket add ModernNotify --version 1.0.0
#r "nuget: ModernNotify, 1.0.0"
#:package ModernNotify@1.0.0
#addin nuget:?package=ModernNotify&version=1.0.0
#tool nuget:?package=ModernNotify&version=1.0.0
Winform Modern MessageBox
A modern and customizable alert windows library for Windows Forms. It allows you to create animated, customizable, and easy-to-use alert windows. This package is the new version of su_ModernAlert package.
Migration Guide from su_ModernAlert
If you are using su_ModernAlert package, follow these steps to migrate to ModernNotify:
- Uninstall the old package:
Uninstall-Package su_ModernAlert
- Install the new package:
Install-Package ModernNotify
- Update your using statements:
// Old
using su_ModernAlert;
// New
using ModernNotify;
- Update your code:
// Old
DialogResult result = su_ModernAlert.ModernAlert.Show(...);
// New
DialogResult result = ModernNotify.ModernAlert.Show(...);
No other code changes are required as all features and functionality remain the same.
Features
- Modern and elegant design
- Multiple animation options (Fade, Slide, Scale, Rainbow, Shake)
- Multi-language support (Turkish, English)
- Customizable icons
- Sound effects
- ProgressBar support
- Async and background working modes
- Customizable button styles
- Auto-close feature
- Default button selection and auto-click feature
- Automatic text translation with dynamic language support (tr-en)
Installation
From NuGet Package Manager Console:
Install-Package ModernNotify
or .NET CLI:
dotnet add package ModernNotify
Usage
ModernAlert Usage
// Modal usage (waits until alert closes)
DialogResult result = ModernAlert.Show(
"Title",
"Message",
AlertType.Info
);
// Async usage
async Task DoSomething()
{
DialogResult result = await ModernAlert.ShowAsync(
"Title",
"Message",
AlertType.Success
);
}
// Background alert
ModernAlert.ShowBackground(
"Information",
"Operation completed",
AlertType.Success,
autoCloseMilliseconds: 2000
);
// Customized alert
DialogResult result = ModernAlert.Show(
"Title",
"Message",
AlertType.Info,
autoCloseMilliseconds: 3000,
playSound: true,
customIcon: myIcon,
animationType: AnimationType.Rainbow,
progressBarStyle: ProgressBarStyle.Marquee
);
ModernQuestion Usage
// Basic usage
DialogResult result = ModernQuestion.ShowQuestion(
"Confirmation",
"Are you sure you want to do this?",
AnimationType.Fade,
null,
LanguageOption.en
);
// Async usage
async Task DoSomething()
{
DialogResult result = await ModernQuestion.ShowQuestionAsync(
"Confirmation",
"Are you sure you want to do this?",
AnimationType.Rainbow,
null,
LanguageOption.en
);
}
// Usage with default button and auto-click feature
DialogResult result = ModernQuestion.ShowQuestion(
"Confirmation",
"Are you sure you want to do this?",
AnimationType.Fade,
null,
LanguageOption.en,
ButtonStyle.Modern,
DialogResult.Yes, // Yes button selected as default
5 // Will auto-click after 5 seconds
);
// Async usage with default button and auto-click feature
async Task DoSomething()
{
DialogResult result = await ModernQuestion.ShowQuestionAsync(
"Confirmation",
"Are you sure you want to do this?",
AnimationType.Fade,
null,
LanguageOption.en,
ButtonStyle.Modern,
DialogResult.No, // No button selected as default
10 // Will auto-click after 10 seconds
);
}
// Customized question
DialogResult result = ModernQuestion.ShowQuestion(
"Confirmation",
"Are you sure you want to do this?",
AnimationType.Rainbow,
customIcon: myIcon,
language: LanguageOption.en,
buttonStyle: ButtonStyle.Modern,
defaultButton: DialogResult.Yes,
autoClickDelay: 5
);
Animation Types
Fade
: Smooth fade transition effectSlide
: Sliding animationScale
: Scaling animationRainbow
: Arc movement and drop effectShake
: Shake animation
Alert Types
Info
: Information message (Blue)Success
: Success message (Green)Warning
: Warning message (Yellow)Error
: Error message (Red)
Language Options
en
: Englishtr
: Turkish
ProgressBar Styles
Blocks
: Blocked viewContinuous
: Continuous viewMarquee
: Scrolling bar view
Button Styles
Default
: Default styleModern
: Modern, flat designClassic
: Classic Windows styleRounded
: Rounded corner button styleGradient
: Gradient (color transition) button style
Default Button Properties
DialogResult.Yes
: Yes button is selected by defaultDialogResult.No
: No button is selected by defaultDialogResult.None
: No default button is selected
Important Notes
- When a default button is selected, the auto-click delay (autoClickDelay) must be greater than 0
- Default button can only take DialogResult.Yes or DialogResult.No values
- In async usage, UI thread is not blocked and animations work more smoothly
- Title and message texts are automatically translated according to the language option
- Button texts are automatically updated according to the selected language
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- System.Windows.Forms (>= 4.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Migration from su_ModernAlert to ModernNotify:
- All features from su_ModernAlert package are preserved
- Package name changed to ModernNotify
- All future updates will be made through this package
- See readme.md for migration instructions
Improvements:
- Fixed visibility issue with long texts in forms opening with scale animation
- Form sizing optimized to ensure complete visibility of message text