AutoClosingMessageBox 1.0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package AutoClosingMessageBox --version 1.0.0.2
NuGet\Install-Package AutoClosingMessageBox -Version 1.0.0.2
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="AutoClosingMessageBox" Version="1.0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AutoClosingMessageBox --version 1.0.0.2
#r "nuget: AutoClosingMessageBox, 1.0.0.2"
#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.
// Install AutoClosingMessageBox as a Cake Addin
#addin nuget:?package=AutoClosingMessageBox&version=1.0.0.2

// Install AutoClosingMessageBox as a Cake Tool
#tool nuget:?package=AutoClosingMessageBox&version=1.0.0.2

Usage:

Use the AutoClosingMessageBox.Show method either as follows:

// Fire and forget - it about to be closed after default timeout(1000ms)
AutoClosingMessageBox.Show("Hello, World!");

or follows:

// Wait for some result or make the default decision
var result = AutoClosingMessageBox.Show(
            text: "To be or not to be?", 
            caption: "The question",
            timeout: 2500,
            buttons: MessageBoxButtons.YesNo,
            defaultResult: DialogResult.Yes);
if(result == DialogResult.Yes) {
    // to be
}
else { 
    // or not
}

You can also use the AutoClosingMessageBox.Factory to get full control on MessageBox showing:

var toBeOrNotToBeQuestion = AutoClosingMessageBox.Factory(
        showMethod: (caption, buttons) =>
            MessageBox.Show(this, "To be or not to be?", caption, buttons, MessageBoxIcon.Question),
        caption: "The question"
    );
if(DialogResult.Yes == toBeOrNotToBeQuestion.Show(
                            timeout: 2500,
                            buttons: MessageBoxButtons.YesNo,
                            defaultResult: DialogResult.Yes)) {
    // to be
}
else {
    // or not
}
Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on AutoClosingMessageBox:

Package Downloads
NKit.Windows

.NET Toolkits (class libraries) containing reusable code for speeding up development of any .NET applications. NKit.Standard is the .NET Standard compatible version of NKit. NKit.Windows is the .NET Framework compatbile version of NKit. NKit.Core is the latest .NET Core compatible version of NKit.

NKit.Windows.Standalone

.NET Toolkits (class libraries) containing reusable code for speeding up development of any .NET applications. NKit.Standard is the .NET Standard compatible version of NKit.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0.5 6,287 12/23/2022
1.0.0.2 45,433 11/3/2017

The MessageBox which automatically closes after the specific timeout.

v1.0.0.2:
- New Show(IWin32Owner) API to support most popular scenarios (in the
context of #1 );
- New Factory() API to provide full control on MessageBox showing;