gpt4 book ai didi

vb.net - FormClosed和FormClosing事件之间的区别

转载 作者:行者123 更新时间:2023-12-03 16:05:47 26 4
gpt4 key购买 nike

VB.NET中,FormClosedFormClosing事件有什么区别?

Private Sub frmTerminal_TCP_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing

End Sub


Private Sub frmTerminal_TCP_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

End Sub

最佳答案

FormClosing发生在FormClosed之前。可以将FormClosing视为对话框,要求您在退出程序之前保存文档。它为您提供了取消窗口终止的机会。

表单关闭后会触发FormClosed。从MS documentation:

The FormClosed event occurs after the form has been closed by the user or by the Close method or the Exit method of the Application class. To prevent a form from closing, handle the FormClosing event and set the Cancel property of the CancelEventArgs passed to your event handler to true.

关于vb.net - FormClosed和FormClosing事件之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33004874/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com