May 27, 2010

WPF MessageBox Dialog Examples

Copy and paste type samples
using System.Windows;
Suprise type dialog:
MessageBox.Show(this,
 "Specified root directory \'" + rootDir + "\'does not exist",
 "Find files",
 MessageBoxButton.OK,
 MessageBoxImage.Exclamation);
Question type dialog:
MessageBox.Show(this,
 "Are you sure you want to delete these files" + Environment.NewLine +
 fileListStr,
 "Delete selected files",
 MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) 

No comments: