WPF窗体右上角叉叉退出应用程序
WPF窗体右上角叉叉退出应用程序
记得xaml里的Window标签响应Closing事件
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (MessageBox.Show("是否确认退出?", "温馨提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { Application.Current.Shutdown(); } else { e.Cancel = true; } }
标签:右上角,应用程序,叉叉,窗体,退出,WPF From: https://www.cnblogs.com/niunan/p/17445997.html