Windows phone toast notification。這可能會幫助你很多。從here下載Coding4Fun.Phone.Toolkit v1.2並在您的解決方案中添加參考。 這裏是示例代碼如何顯示按鈕單擊自定義通知(消息)可能這會幫助你。
private void btnCustomizedToastPrompt_Click(object sender, RoutedEventArgs e)
{
SolidColorBrush gray = new SolidColorBrush(Colors.LightGray);
SolidColorBrush orange = new SolidColorBrush(Color.FromArgb(200, 255, 117, 24));
ToastPrompt toast = new ToastPrompt
{
Background = gray,
Foreground = orange,
Title = "Customized",
Message = "Custom colors",
FontSize = 30,
TextOrientation = System.Windows.Controls.Orientation.Vertical,
ImageSource =
new BitmapImage(new Uri("ApplicationIcon.png", UriKind.RelativeOrAbsolute))
};
toast.Completed += toast_Completed;
toast.Show();
}
好的謝謝和什麼控制消息框的顏色?我可以添加一個額外的參數來設置顏色嗎? –
不幸的是,你不能設置MessageBox的顏色。但是,您可以使其顯示提示並讓用戶選擇一個選項,例如:確定或取消。 MessageBox是向用戶顯示信息的最簡單方式。 – kdh
'錯誤\t方法'Show'沒有超載需要2個參數\t'這是正確的語法嗎? –