c# – 忽略WPF应用程序中的Alt F4
发布时间:2020-12-15 06:43:49 所属栏目:百科 来源:网络整理
导读:如何在 WPF应用程序中忽略Alt F4? 解决方法 您可以在TForm上施加OnClosing事件,并设置cea.Cancel = true;当cea是FromClosing参数的CancelEventArgs时. http://msdn.microsoft.com/en-us/library/system.windows.forms.form.onclosing.aspx C# private void
如何在
WPF应用程序中忽略Alt F4?
解决方法
您可以在TForm上施加OnClosing事件,并设置cea.Cancel = true;当cea是FromClosing参数的CancelEventArgs时.
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.onclosing.aspx C# private void Form1_Closing(Object sender,CancelEventArgs e) { e.Cancel = true; } C void Form1_Cancel( Object^ /*sender*/,CancelEventArgs^ e ) { e->Cancel = true; } VB.NET Private Sub Form1_Closing(sender As Object,e As _ System.ComponentModel.CancelEventArgs) Handles MyBase.Closing e.Cancel = True End Sub 'Form1_Closing (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |