Is there a standard message box in WPF, like WinForms' System.Windows.Forms.MessageBox.Show()
, or should I use the WinForms message box?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
WPF contains the following MessageBox:
The equivalent to WinForms'
MessageBox
in WPF is calledSystem.Windows.MessageBox
.As the others say, there is a
MessageBox
in the WPF namespace (System.Windows
).The problem is that it is the same old messagebox with OK, Cancel, etc. Windows Vista and Windows 7 have moved on to use Task Dialogs instead.
Unfortunately there is no easy standard interface for task dialogs. I use an implementation from CodeProject KB.
The MessageBox in the Extended WPF Toolkit is very nice. It's at Microsoft.Windows.Controls.MessageBox after referencing the toolkit DLL. Of course this was released Aug 9 2011 so it would not have been an option for you originally. It can be found at Github for everyone out there looking around.
Maybe the code here below helps:
You can use this:
For more information, visit MessageBox in WPF.