WpfMessageBox 1.3.0

dotnet add package WpfMessageBox --version 1.3.0
                    
NuGet\Install-Package WpfMessageBox -Version 1.3.0
                    
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="WpfMessageBox" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WpfMessageBox" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="WpfMessageBox" />
                    
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 WpfMessageBox --version 1.3.0
                    
#r "nuget: WpfMessageBox, 1.3.0"
                    
#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 WpfMessageBox@1.3.0
                    
#: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=WpfMessageBox&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=WpfMessageBox&version=1.3.0
                    
Install as a Cake Tool

WpfMessageBox

Nuget build:master status

Description

WpfMessageBox is a WPF message box implementation, aimed to be visually balanced between the default WPF style and the native .NET MessageBox. It offers the following features:

  • Returns the standard .NET MessageBoxResults.
  • Uses the standard MessageBox icons.
  • Ability to define custom buttons text.
  • Optional header text.
  • Optional TextBox.
  • Optional CheckBox.

Screenshot 1 Screenshot 2

Usage

  1. Install through Nuget

  2. WpfMessageBox uses static method like the standard .NET MessageBox:

    using WpfMessageBoxLibrary;
    
    MessageBoxResult result = WpfMessageBox.Show("Some text", "Some title", MessageBoxButton.OK, MessageBoxImage.Exclamation);
    
  3. In order to use the extra features offered by WpfMessageBox, you need to initialize a new WpfMessageBoxProperties which will hold the desired properties, then use the relevant static method:

    using WpfMessageBoxLibrary;
    
    var msgProperties = new WpfMessageBoxProperties() {
        Button = MessageBoxButton.OKCancel,
        ButtonOkText = "Set name",
        CheckBoxText = "Don't ask again",
        Image = MessageBoxImage.Exclamation,
        Header = "No name defined",
        IsCheckBoxChecked = true,
        IsCheckBoxVisible = true,
        IsTextBoxVisible = true,
        Text = "Please enter the name to use. You can leave the field empty in order to continue using the default name.",
        Title = "A nice example",
    };
    
    MessageBoxResult result = WpfMessageBox.Show(this, ref msgProperties);
    
  4. The WpfMessageBoxProperties object allows you to retrieve the TextBox and CheckBox values after the user closed the message box:

    bool checkBoxChecked = msgProperties.IsCheckBoxChecked;
    string textBoxContent = msgProperties.TextBoxText;
    

More examples can be found in the Demo project of this repository.

Release notes

See the changelog.

License

WpfMessageBox is licensed under the MIT license - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net9.0-windows7.0 is compatible.  net10.0-windows was computed. 
.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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on WpfMessageBox:

Repository Stars
Otiel/BandcampDownloader
A Windows app used to download albums from Bandcamp.
Version Downloads Last Updated
1.3.0 296 10/19/2025
1.2.0 6,881 6/14/2019
1.1.1 736 6/10/2019
1.1.0 718 6/10/2019

See CHANGELOG on source repository.