开发者

Does anyone know how to get the WPF MessageBox to look better (like the Windows Forms equivelant)? [duplicate]

This question already has answers here: Closed 开发者_如何学Go11 years ago.

Possible Duplicate:

WPF MessageBox window style

For some reason the MessageBox that comes with WPF has visual styles disabled and I can't find a way to turne them on, in Windows Forms it was simply a matter of calling Application.EnableVisualStyles() at the start of your program.

To get an idea of what I'm talking about, here are the two examples:

System.Windows.Forms.Application.EnableVisualStyles();
System.Windows.Forms.MessageBox.Show(
    "Windows Forms Dialog",
    "Message Box Test",
    System.Windows.Forms.MessageBoxButtons.OK,
    System.Windows.Forms.MessageBoxIcon.Asterisk);

Does anyone know how to get the WPF MessageBox to look better (like the Windows Forms equivelant)? [duplicate]

System.Windows.MessageBox.Show(
    "WPF Dialog",
    "Message Box Test",
    System.Windows.MessageBoxButton.OK,
    System.Windows.MessageBoxImage.Asterisk);

Does anyone know how to get the WPF MessageBox to look better (like the Windows Forms equivelant)? [duplicate]

Calling System.Windows.Forms.Application.EnableVisualStyles() has no affect for WPF.

The Extended WPF Toolkit has a nice themable implementation, but I'm looking for a way to create message boxes that match the operating system that the user is running on. The EWPFT implementation is fantastic if you want the same style on every operating system.


Don't use MessageBox anymore, P/Invoke TaskDialogIndirect instead - it looks nicer than both of those, and has more options (for example, having arbitrary button text)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜