SGU.Tools_MessageBoxTimed 3.5.26

There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SGU.Tools_MessageBoxTimed" Version="3.5.26" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SGU.Tools_MessageBoxTimed" Version="3.5.26" />
                    
Directory.Packages.props
<PackageReference Include="SGU.Tools_MessageBoxTimed" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SGU.Tools_MessageBoxTimed --version 3.5.26
                    
#r "nuget: SGU.Tools_MessageBoxTimed, 3.5.26"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SGU.Tools_MessageBoxTimed@3.5.26
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SGU.Tools_MessageBoxTimed&version=3.5.26
                    
Install as a Cake Addin
#tool nuget:?package=SGU.Tools_MessageBoxTimed&version=3.5.26
                    
Install as a Cake Tool

MessageBoxTimed

A Windows Forms message box that automatically closes after a specified timeout period with optional countdown display.

NuGet Version Buy Me A Coffee

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last Updated
3.7.1 89 1/14/2026
3.6.4 94 1/8/2026
3.5.28 93 12/30/2025
3.5.26 88 12/30/2025