When there is a need to display information or ask a question it’s common to use MsgBox or MessageBox which for most cases works.

Then there are cases when the button text is not suffice, different text is needed or there is a need for inclusion of CheckBox(s), RadioButton(s). And then there are times when a requirement to auto-close a message box is needed.

The solution many developers come up with is to create a form with controls to fill their requirements, write or find API wrappers and in some cases find a NuGet package that works for them.

An alternate starting with .NET Core 5 is TaskDialogPage which when written into methods in a dedicated class can elevate the need to create forms to match requirements that MessageBox does not allow and/or when dealing with API wrappers that may fail to work in a newer release of the .NET Core Framework.

Microsoft has code samples for TaskDialogPage but unless you want to download the code samples an entire GitHub repository needs to be downloaded or those familiar with Git command can target the code for TaskDialogPage.

Instead check out the following GitHub repository which has a class project dedicated to wrappers around TaskDialogPage for Question dialog, Information dialog, Error dialog, using Radio buttons, CheckBox, ProgressBar, headers, footers and auto-close. Also there is a code sample for “Do not show again”

Although there are plenty examples consider reading the docs to see what else is available.

Name:  dialogs.jpg
Views: 52
Size:  38.5 KB

Name:  dialogMethods.png
Views: 51
Size:  25.0 KB