比如form1上按个按钮,隐藏form1,打开form2,然后在form2上直接按X关闭程序的话,内存里面的进程不会被关闭.
只要在form2的closing事件中加入如下代码就可以关闭程序进程了
Private Sub Form2Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Application.ExitThread()
Application.Exit()
End Sub
只要在form2的closing事件中加入如下代码就可以关闭程序进程了
Private Sub Form2Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Application.ExitThread()
Application.Exit()
End Sub