可能重複:
WPF MessageBox window style有誰知道如何讓WPF MessageBox看起來更好(如Windows窗體equivelant)?
出於某種原因,附帶WPF的MessageBox
已禁用視覺樣式,我無法找到一個方法來turne他們,在Windows窗體它只是在程序開始時調用Application.EnableVisualStyles()
。
要得到什麼,我談論的想法,這裏有兩個例子:
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);
System.Windows.MessageBox.Show(
"WPF Dialog",
"Message Box Test",
System.Windows.MessageBoxButton.OK,
System.Windows.MessageBoxImage.Asterisk);
調用System.Windows.Forms.Application.EnableVisualStyles()
爲WPF沒有影響。
Extended WPF Toolkit有一個很好的可實現的實現,但我正在尋找一種方法來創建消息框,以匹配用戶正在運行的操作系統。如果你想在每個操作系統上使用相同的風格,EWPFT的實現非常棒。
我必須道歉,沒錯,這是一個重複,不知道爲什麼我沒有在搜索結果中看到它。 – 2011-04-22 19:34:30
沒問題。我在自己面前遇到了這個問題,所以我知道要搜索「wpf messagebox manifest」。 – 2011-04-22 19:36:54