8

How to create these beautiful message/dialog boxes (example: http://i.msdn.microsoft.com/dynimg/IC123363.png) in C#?

Is there a function similar to MessageBox.Show in the .NET Framework?

6 Answers 6

8

It is a TaskDialog. It is wrapped in a managed class by the Windows API Code Pack. Lots of other Vista and Win7 specific goodies in there as well.

2
  • 2
    It was discontinued. Just take the first google hit, to arrive at this page. Oct 21, 2014 at 13:32
  • I guess NuGet is the only place it can be found now. Unfortunate that Microsoft completely disowned this. Oct 21, 2014 at 15:42
4

I always hesitate to provide a codeproject link, but I think you're trying to make a TaskDialog. There's also a project on code.msdn.microsoft.com that claims to provide the WinForms TaskDialog. A more reliable source of the TaskDialog is the Windows API Code Pack.

Be certain to provide an alternate message box if you need to support WindowsXP or older operating systems, Task Dialogs are new in Windows Vista.

2
  • 3
    What's wrong with Code Project links? Or, why the hesitation. I think CP is a great resource. For me: CP + SO = bread + butter
    – Paul Sasik
    Jun 25, 2010 at 20:13
  • 1
    CodeProject is very hit-or-miss when it comes to quality and correctness of solutions, in my experience. I've seen way too many articles on codeproject that do something fundamentally wrong or silly to trust it in the general case. There are some very high quality articles up there as well, but I've found them to be the exception, not the rule. The day I inherited a piece of production code that used codeproject.com/KB/cpp/colorprogressbar.aspx was a day I wanted to poke my eyes out.
    – Greg D
    Jun 25, 2010 at 21:20
2

Take a look at http://code.msdn.microsoft.com/WindowsAPICodePack I'm not sure it contains feature you need, but it has feature named 'Windows Vista and Windows 7 Task Dialogs', maybe it is thing you looking for.

-1

You can make your own message windows form which appear what you want and show it with form show

MyMessageForm form = new MyMessageForm();
form.Show();
-1

Try to use Task Dialog. It is almost similar to MessageBox. Maybe you will like it. You just need to add the windowsAPIcode Pack to your reference and follow the instructions on the link i gave.

This site will be great help. http://www.developerfusion.com/article/71793/windows-7-task-dialogs/ Here is an example below: try it!

               // Get reference to the dialog type.
               var dialogTypeName = "System.Windows.Forms.PropertyGridInternal.GridErrorDlg";
               var dialogType = typeof(Form).Assembly.GetType(dialogTypeName);

               // Create dialog instance.
               var dialog = (Form)Activator.CreateInstance(dialogType, new PropertyGrid());

               // Populate relevant properties on the dialog instance.
               dialog.Text = "Data Patch";
               dialogType.GetProperty("Details").SetValue(dialog, "Sample Text", null);
               dialogType.GetProperty("Message").SetValue(dialog, "Sample Text", null);

               // Display dialog.
               var result = dialog.ShowDialog();

Pardon me @MegaTron for incomplete answer. I already revised it. I hope this answer will help also

0
-2

DevExpress is a mature 3rd party windows form provider that is worth a look if you are interested.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.