끝내기 옵션이있는 메뉴와 창 닫기를 통해 응용 프로그램을 닫고 싶습니다. 그리고 둘 다 프롬프트 메시지를 추가했습니다. 내가 System.Windows.Application.Current.Shutdown();
후 종료 후 프롬프트 메시지를 두 번 때문에 Exit_Click
이벤트에 제공이라고하면 는하지만 ShellWindow_Closing
당신은 Exit
버튼을 누를 때마다종료 메뉴 및 종료 이벤트를 통해 C# 종료 응용 프로그램
public partial class SWindow : Window
{
public SWindow()
{
this.Closing += ShellWindow_Closing;
}
private void ShellWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (MessageBox.Show("Any running migration task will be aborted. \nAre you sure you want to exit the application ?",
"Exit Proventeq Migration Acclerator",
MessageBoxButton.YesNo,
MessageBoxImage.Question) == MessageBoxResult.No)
e.Cancel = true;
}
}
private void Exit_Click(object sender, RoutedEventArgs e)
{
if (MessageBox.Show("Any running migration task will be aborted. \nAre you sure you want to exit the application ?", "Exit Proventeq Migration Acclerator", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
e.Handled = true;
}
질문의 형식을 지정하십시오. – FCin
[X 버튼을 클릭했을 때 확인 메시지 요청] (0120-998-301) –
종료 메뉴에서 처리기 집합 e.Handled = true, 그럼 다른 처리기를 호출해서는 안됩니다 – adminSoftDK