2

The Microsoft's User Experience Interaction Guidelines for Windows 7 and Windows Vista suggests creating dialog boxes with a title, the main instructions and a context. For example:

enter image description here

But... the method Show of the class MessageBox accepts, at most, a text (=main instructions) and a caption (=title).

How can I create a dialog box like the one above with a large blue text for the main instructions and a small black text for the context?

I'm using C# with .NET 4 and WPF.

Dev
  • 7,027
  • 6
  • 37
  • 65
  • What is your requirement ? Dialog box is quite different from a MessageBox. A MessageBox just for prompting the user with a simple message with an appropriate icon,description etc... You cannot do what you're trying to do on a MessageBox – this-Me Apr 27 '12 at 08:43
  • Hello! I would like to create a dialog box identical to that shown above. Thank you! – Dev Apr 27 '12 at 08:55

3 Answers3

4

That's a TaskDialog, which was introduced in Windows Vista. See this for an example of how to use it. If you call it on an earlier version of Windows, it'll fail. You should check the OS version yourself, and call MessageBox in that case.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
  • Great, thank you! The article you linked said that the _"Only limitation of Task Dialog API is it doesn’t supported by Windows operating systems less than Windows Vista"._ But does it means that I have to check the current version of the operating system and if < Windows Vista I have to use the old `MessageBox`? Or is it automatic? – Dev Apr 27 '12 at 08:47
1

you can check the messagbox from here.

and taskdialog from here.

or simply built the messagebox you want. how dialogs are done with mvvm goes here.

Community
  • 1
  • 1
blindmeis
  • 22,175
  • 7
  • 55
  • 74
0

OOkii.Dialogs is a nice little free library that takes the pain out of a whole range of dialogs for WPF including handling dropping back to older dialogs on OSs that dont support new ones.

Ricibob
  • 7,505
  • 5
  • 46
  • 65