本文介绍了在Windows关闭(X)按钮上打开另一个窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好, 我有两个带按钮的winforms。我可以通过按钮在表单之间导航。现在我想捕捉窗口关闭(X)按钮导航到下一个窗体。但当我处理窗口关闭或关闭事件时,项目停止。请帮帮我。 ThaksHi All,I Have two winforms with buttons. I'm able to navigate between forms though buttons. Now i want to capture windows close(X) button to navigate to next form. But when I handle the windows close or closing events the projects stops. Please help me with this.Thaks推荐答案MySecondForm msf = new MySecondForm();Hide();msf.ShowDialog();Show(); 这样,当你的第二个表单关闭时,你的第一个表单再次显示,用户仍然可以关闭主表单以退出应用程序。That way, when your second form closes, your first displays again, and the user can still close the main form to exit the application. 这篇关于在Windows关闭(X)按钮上打开另一个窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-23 13:14