Skip to content

nmoschkin/MessageBoxEx

Repository files navigation

DataTools.MessageBoxEx

Version 1.2

January 4th, 2023

Eliminated redundant packages. All projects are now multi-target.

The minimum .NET version is now .NET 6, and the minimum .NET Framework version is 4.8.

NuGet packages are coming.

Customizable replacement for the system MessageBox class

DataTools.MessageBoxEx is a highly customizable replacement for the system MessageBox class for both WPF and WinForms applications.

It is intended to look and behave as closely as possible to the native MessageBox.

(The message box will render in the Visual Style of the calling application.)

Some features include:

  • Custom Buttons

    You can define completely custom buttons that return either a MessageBoxExResult or a custom result of any type.

  • Custom Icons

    The main icon and buttons icons are completely customizable:

  • Control Over Sounds

    When the message box is shown it can:

    • Play the default system sound for a specific system icon.
    • Play a different system sound.
    • Mute sounds, altogether.
  • Standard System Dialog Boxes

    • OK button
    • OK and Cancel buttons
    • Yes and No buttons
    • Yes, No, and Cancel buttons
    • Yes, No, and Yes To All buttons
    • Abort, Retry, and Ignore buttons

  • Check Boxes

    A checkbox option can be placed immediately to the left of the buttons on the message box.

    • (Note, a checkbox and a hyperlink cannot appear together, at the same time)

  • Hyper Links

    A hyperlink that can execute any location that is valid in the Windows shell (applications, URLs, special folders, etc.)

    • Note: a checkbox and a hyperlink cannot appear together, at the same time.
    • In keyboard navigation, the hyperlink on the message box can be activated by pressing Ctrl + Enter

  • Drop-Down Menus

    Custom buttons can have a drop-down menu with arrow button attached.

    • In keyboard navigation, the drop-down menu can be activated for the button with focus by pressing Ctrl + Down Arrow

  • Automatic Sizing

    Gracefully and accurately sizes the dialog box to fit even very large content.

    • This feature is limited by screen size.

  • Resource-based Internationalization

    Language resources from your own project can be referenced by MessageBoxEx to render standard dialog types by using the ResourceTextConfig static property.

    • See the example project for an example. Note that the example project contains two resources, AppResources.resx and AppResources.fr.resx. The fr in the second file is the two letter ISO language code for French. Applications using resource-based internationalization will automatically pick the best set of resources to use based on the user's current system language and culture settings, but this behavior can be overridden. Browse ResourceTextConfig.cs to see what's involved.
  • If you prefer the old-fashioned 3D look

    The message box will render in the Visual Style of the calling application.

    You can override the default visual style of your application by launching the message box in a new process using ShowInNewProcess.

Releases

No releases published

Packages

No packages published

Languages