Glass.Message
1.0.4
See the version list below for details.
dotnet add package Glass.Message --version 1.0.4
NuGet\Install-Package Glass.Message -Version 1.0.4
<PackageReference Include="Glass.Message" Version="1.0.4" />
<PackageVersion Include="Glass.Message" Version="1.0.4" />
<PackageReference Include="Glass.Message" />
paket add Glass.Message --version 1.0.4
#r "nuget: Glass.Message, 1.0.4"
#:package Glass.Message@1.0.4
#addin nuget:?package=Glass.Message&version=1.0.4
#tool nuget:?package=Glass.Message&version=1.0.4
πͺ Glass.Message
The modern MessageBox replacement for .NET WinForms β Windows 11 ready, zero migration cost.
Mica & Acrylic backdrops Β· automatic dark/light theming Β· fluent builder API Β· async/await dialogs Β· inline text & password inputs Β· activity-aware live progress bars Β· toast notifications Β· per-monitor DPI Β· full RTL support.

Why Glass.Message?
System.Windows.Forms.MessageBox hasn't changed since Windows XP. It ignores dark mode, ignores your monitor's DPI, can't be awaited, and looks out of place on Windows 10/11. Glass.Message replaces it with a single type-name change β the Show(...) overloads are 100% signature-compatible and still return DialogResult.
// Before β flat grey dialog, blocks the thread, ignores dark mode
MessageBox.Show("Save failed. The file is in use by another process.",
"Save Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
// After β same one-liner, now modern, themed, DPI-aware, animated
GlassMessage.Show("Save failed. The file is in use by another process.",
"Save Error", MessageBoxIcon.Error);
No new dependencies. No additional configuration. Works on .NET Framework 4.8.1 and .NET 8 / 9 / 10.
Install
dotnet add package Glass.Message
Feature comparison
| Capability | MessageBox |
Glass.Message |
|---|---|---|
| Dark / light mode | β | β auto-detect |
| Windows 11 Mica backdrop | β | β |
| Windows 10 Acrylic blur | β | β |
| Rounded corners (DWM) | β | β |
| Per-monitor DPI scaling | β | β |
async / await support |
β | β |
CancellationToken support |
β | β |
| Open/close animations | β | β Fade, Slide, Scale |
| Inline text / password input | β | β |
| Inline drop-down input | β | β |
| Live progress bar | β | β determinate + marquee |
| Activity-aware progress animation | β | β upload / download / sync / compress / β¦ |
| Checkbox ("don't show again") | β | β |
| Expandable detail panel | β | β |
| Toast notifications | β | β 6 positions, multi-monitor |
| Custom button labels | β | β |
| Custom themes | β | β |
| High contrast accessibility | system only | β dedicated preset |
| Right-to-left layout | β | β |
| Countdown auto-close | β | β |
Ctrl+C copies content |
β | β |
| .NET Framework 4.8.1 | β | β |
| .NET 8 / 9 / 10 | β | β |
Quick start
using Glass;
using System.Windows.Forms;
// Optional β set once at startup (e.g. in Program.cs or Form_Load)
GlassMessage.UseRoundedCorners = true; // Windows 11 rounded corners
GlassMessage.DefaultTheme = GlassTheme.AutoDetect(); // follow the OS light / dark theme
GlassMessage.PlaySystemSounds = true; // match classic MessageBox behaviour
// Drop-in replacement (same signature, same DialogResult)
DialogResult result = GlassMessage.Show(
"Your changes have been saved.", "Success", MessageBoxIcon.Information);
Examples
Custom buttons + fluent builder
var r = GlassMessage.Create("Annual_Report_Q4.xlsx has unsaved changes.")
.Title("Unsaved Changes")
.Icon(MessageBoxIcon.Warning)
.Buttons("Save", "Don't Save", "Cancel")
.Show();
Text / password input
// Text input with a checkbox
var r = GlassMessage.Create("Enter a new name for this folder.")
.Title("Rename")
.InputText("Folder name", "Client Projects")
.CheckBox("Apply to sub-folders")
.Buttons("Rename", "Cancel")
.ShowEx();
if (r.Button == DialogResult.OK)
RenameFolder(r.InputText, applyRecursive: r.CheckBoxChecked);
// Password input (masked, with reveal-eye toggle and Caps Lock hint)
var r = GlassMessage.Create("Enter your vault password to continue.")
.Title("Authentication Required")
.Icon(MessageBoxIcon.Shield)
.InputPassword("Password")
.Buttons("Unlock", "Cancel")
.ShowEx();
Async dialogs with CancellationToken
// Non-blocking β the UI stays responsive while the dialog is open
var choice = await GlassMessage.ShowAsync(
"Push local changes to origin/main?", "Sync",
MessageBoxIcon.Question, MessageBoxButtons.OKCancel);
// Cancellable from code β e.g. session timeout after 30 s
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
var result = await GlassMessage.Create("Confirm deployment to production?")
.Title("Deploy")
.Icon(MessageBoxIcon.Warning)
.Buttons("Deploy Now", "Cancel")
.ShowAsync(cts.Token);
Live progress dialog (activity-aware)
The bar can animate to match the operation β Upload, Download, Sync, Compress, and more β and you can switch the activity live as the work moves between phases:
var ctrl = GlassMessage.Create("Uploading files to cloud storageβ¦")
.Title("Upload")
.Progress(0, 100)
.ProgressActivity(GlassProgressActivity.Upload) // glowing packets flow β
.Buttons("Cancel")
.ShowProgress();
for (int i = 0; i <= 100; i += 10)
{
if (ctrl.WasCanceledByUser) break;
ctrl.SetValue(i);
ctrl.SetMessage($"Uploading file {i / 10 + 1} of 10β¦");
await Task.Delay(500);
}
ctrl.Complete();
await ctrl.Completion;
Toast notifications
// Fire-and-forget, bottom-right corner, auto-dismiss after 4 s
GlassToast.Show("Invoice #1042 saved to SharePoint.", "Upload Complete",
MessageBoxIcon.Information);
// Awaitable toast β continues after the notification disappears
await GlassToast.ShowAsync(new GlassToastOptions
{
Title = "Build finished",
Message = "Release x64 completed in 4.2 s.",
Icon = MessageBoxIcon.None,
Position = ToastPosition.TopRight,
DurationMs = 6_000,
OnClick = () => OpenBuildLog(),
});



Theming
Five built-in presets β pick one or build your own:
| Preset | Description |
|---|---|
GlassTheme.Default |
Dark blue (ships as the default) |
GlassTheme.Light |
Bright palette for light-mode apps |
GlassTheme.Mica |
Neutral, tuned for Windows 11 Mica backdrop |
GlassTheme.HighContrast |
Full Windows system-colour accessibility preset |
GlassTheme.WindowsClassic |
Square, opaque β matches traditional Windows chrome |
GlassTheme.AutoDetect() |
Chooses Dark / Light / HighContrast at runtime |
Target frameworks & platforms
| Framework | Notes |
|---|---|
.NET Framework 4.8.1 |
Full support, ships explicit WinForms references |
.NET 8.0-windows |
LTS |
.NET 9.0-windows |
Current |
.NET 10.0-windows |
Preview |
AnyCPU β runs in both x86 and x64 processes.
Windows-only (WinForms). No third-party runtime dependencies.
Documentation & links
- π Full docs, gallery & API reference: https://github.com/gcfernando/glass
- π Changelog: https://github.com/gcfernando/glass/blob/main/CHANGELOG.md
- β¬οΈ Releases & pre-built binaries: https://github.com/gcfernando/glass/releases
- π Issues & feature requests: https://github.com/gcfernando/glass/issues
MIT Licensed Β· Β© 2026 Gehan Fernando
Keywords: WinForms MessageBox replacement, Windows Forms modern dialog, dark mode dialog .NET, Windows 11 Mica dialog, Acrylic WinForms, async MessageBox C#, WinForms toast notification, DPI-aware dialog, WinForms progress dialog, WinForms input dialog, WinForms password dialog, themed dialog WinForms, GlassMessage, Glass.Message
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net9.0-windows7.0 is compatible. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
| .NET Framework | net481 is compatible. |
-
.NETFramework 4.8.1
- No dependencies.
-
net10.0-windows7.0
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
-
net9.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.
A feature release that makes the live progress dialog *activity-aware* β the
bar can now animate to match the operation it represents (upload, download,
sync, compress, β¦) β plus visual-polish and performance fixes for the progress
bar.
### Added
- **`ProgressActivity(GlassProgressActivity)` builder method** and the new
**`GlassProgressActivity`** enum (17 activities). The progress bar paints a
distinct, eye-catching animation grouped into six visual families:
| Family | Animation | Activities |
|---|---|---|
| **Packets** | glowing dots glide along | `Upload` · `Download` · `Stream` |
| **Chevrons** | diagonal bands march | `FileTransfer` · `Import` |
| **Segments** | rounded blocks march | `Compress` · `Extract` · `Export` |
| **Wave** | a sinusoidal ripple | `Backup` · `Restore` · `Sync` |
| **Pulse** | the fill breathes | `Encrypt` · `Decrypt` · `Connecting` |
| **Comet** | a soft shine sweeps | `Install` · `Search` · `Processing` |
Stripes flow forward for outgoing work, backward for incoming, and ease both
ways for a two-way sync. Works on both determinate and indeterminate bars; use
`GlassProgressActivity.None` for a plain bar.
- **`GlassProgressController.SetActivity(GlassProgressActivity)`** β change the
flow animation live as an operation moves between phases (e.g. `Compress` then
`Upload`).
### Fixed
- **Progress bar "box" artifact** β the progress panel now paints the dialog's
themed gradient behind itself (like every other custom control) instead of
clearing to a flat colour, so it blends into the window seamlessly rather than
showing a dark rectangle around the track.
- **Progress bar visibility** β boosted the contrast of every activity animation
so the styles read clearly at the standard bar height.
### Performance
- **No per-frame allocations in the animated progress panel** β the glow-dot
sprite, themed-background gradient, track border pen, flow brushes, and chevron
geometry are all cached/reused, so an animating progress dialog no longer
churns GDI+ objects at 30 fps.