MessageBox 사용하기
C# 2007. 9. 2. 13:24 |//그냥 해당 글을 출력할때
MessageBox.Show("Closing called");
//해당 결과를 받아서 처리 하고 싶을때
string msg = "Data is dirty. Close without saving?";
MessageBoxResult result =
MessageBox.Show(
msg,
"Data App",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result == MessageBoxResult.No)
{
// If user doesn't want to close, cancel closure
e.Cancel = true;
}
MessageBox.Show("Closing called");
//해당 결과를 받아서 처리 하고 싶을때
string msg = "Data is dirty. Close without saving?";
MessageBoxResult result =
MessageBox.Show(
msg,
"Data App",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result == MessageBoxResult.No)
{
// If user doesn't want to close, cancel closure
e.Cancel = true;
}