SGU.Tools_MessageBoxTimed
3.5.26
See the version list below for details.
dotnet add package SGU.Tools_MessageBoxTimed --version 3.5.26
NuGet\Install-Package SGU.Tools_MessageBoxTimed -Version 3.5.26
<PackageReference Include="SGU.Tools_MessageBoxTimed" Version="3.5.26" />
<PackageVersion Include="SGU.Tools_MessageBoxTimed" Version="3.5.26" />
<PackageReference Include="SGU.Tools_MessageBoxTimed" />
paket add SGU.Tools_MessageBoxTimed --version 3.5.26
#r "nuget: SGU.Tools_MessageBoxTimed, 3.5.26"
#:package SGU.Tools_MessageBoxTimed@3.5.26
#addin nuget:?package=SGU.Tools_MessageBoxTimed&version=3.5.26
#tool nuget:?package=SGU.Tools_MessageBoxTimed&version=3.5.26
MessageBoxTimed
A Windows Forms message box that automatically closes after a specified timeout period with optional countdown display.
Features
- Auto-close message boxes after a specified timeout
- Optional countdown timer display on buttons
- Full support for all MessageBoxButtons configurations
- Factory pattern for reusable message box configurations
- Thread-safe implementation
Installation
Install via NuGet Package Manager Console:
Install-Package SGU.Tools_MessageBoxTimed
Or via .NET CLI:
dotnet add package SGU.Tools_MessageBoxTimed
Usage
Basic Usage
using SGU.Tools;
// Simple auto-closing message box (closes after 1000ms by default) MessageBoxTimed.Show("Operation completed successfully!");
With Timeout and Buttons
// Wait for user input or auto-close with default result var result = MessageBoxTimed.Show( text: "Save changes before closing?", caption: "Confirm", timeout: 5000, buttons: MessageBoxButtons.YesNoCancel, defaultResult: DialogResult.Cancel );
With Countdown Display
// Show countdown timer on the default button MessageBoxTimed.Show( text: "This will close automatically...", caption: "Auto-Close Demo", timeout: 5000, showCountDown: true );
With Owner Window
// Display as modal to a specific window MessageBoxTimed.Show( owner: this, text: "Processing complete!", caption: "Success", timeout: 3000 );
Factory Pattern
// Create reusable message box configuration var confirmDialog = MessageBoxTimed.Factory( showMethod: (caption, buttons) ⇒ MessageBox.Show(this, "Are you sure?", caption, buttons, MessageBoxIcon.Question), caption: "Confirmation Required", showCountDown: true );
// Use it multiple times var result = confirmDialog.Show( timeout: 10000, buttons: MessageBoxButtons.YesNo, defaultResult: DialogResult.No );
API Reference
MessageBoxTimed.Show()
| Parameter | Type | Default | Description |
|---|---|---|---|
| text | string | - | The message text to display |
| caption | string | null | The title bar text |
| timeout | int | 1000 | Timeout in milliseconds |
| buttons | MessageBoxButtons | OK | Buttons to display |
| defaultResult | DialogResult | None | Result when timeout expires |
| showCountDown | bool | false | Show countdown on button |
MessageBoxTimed.Factory()
| Parameter | Type | Default | Description |
|---|---|---|---|
| showMethod | Func<string, MessageBoxButtons, DialogResult> | - | Custom show method |
| caption | string | null | The title bar text |
| showCountDown | bool | false | Show countdown on button |
Platform Support
- .NET 4.8 (Windows)
- .NET 6.0 (Windows)
- .NET 8.0 (Windows)
- .NET 9.0 (Windows)
- .NET 10.0 (Windows)
- Requires Windows OS (uses Win32 APIs)
License
Licensed under the MIT License.
Author
Solutions Group Unlimited, LLC
Copyright © 2025 Solutions Group Unlimited, LLC. All rights reserved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net10.0-windows7.0
- No dependencies.
-
net6.0-windows7.0
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.