WebView2, a browser for WinForms in .NET 5

In .NET 5, WinForms got a WebView2 control for displaying web pages.. even ones we create on-the-fly while the app’s running. Let’s kick the tires.

January 17, 2025

TaskDialog, a new message box for WinForms in .NET 5

In .NET 5, WinForms got a major upgrade to the MessageBox called TaskDialog. It’s way more flexible and powerful - let’s check it out!

December 31, 2024

Async, CancellationToken, and IProgress in 5 Short Examples

Async code isn’t always intuitive, but practicing helps. Let’s take a look at Async, CancellationToken, and IProgress, in a few short examples.

October 7, 2024

Simple ways to notify a user without a MessageBox in WinForms

When sending notifications in a WinForms app, a MessageBox is the only way to go… or is it? Let’s get creative and see what else we might do.

August 16, 2023

How to call an async method from a synchronous one, without deadlocking

Writing async code whenever possible is great, but how do we do it when we’re stuck with legacy (and very synchronous) code?

August 11, 2023

How to log messages to multiple targets with NLog

When it comes to finding a bug in an app, few things beat a good trail of logs. And for writing those logs, few tools beat NLog in simplicity or flexibility. I rarely appreciate just how flexible it is though, so it’s worth spending a little time taking a closer look.

July 2, 2023

Using Tuples and deconstruction to return multiple values in C#

A big challenge with any language is trying to group and organize things sensibly, and returning multiple values is no exception. Let’s check out Tuples and deconstruction, and see how they can help us out.

January 5, 2023

Converting a BackgroundWorker to a Task with TaskCompletionSource

Sometimes the safer way to “update” old code is to leave it be and paint over it with a newer construct. Let’s see how to modernize a BackgroundWorker using Tasks and TaskCompletionSource.

December 6, 2022

Named arguments in C#

Named arguments in C#.. they’ve been around a long time, but does anyone use them? Let’s check out another feature that helps tame wild code.

October 12, 2022

Using string interpolation to craft readable strings in C#

The longer I write software, the more I come to appreciate clear code. String interpolation in C# is just one more way to help us do that.

September 19, 2022