ShutdownMode ShutdownMode ShutdownMode ShutdownMode Enum

定义

指示哪个条件应使 Windows 窗体应用程序关闭。Indicates which condition should cause a Windows Forms application to shut down.

public enum class ShutdownMode
public enum ShutdownMode
type ShutdownMode = 
Public Enum ShutdownMode
继承

字段

AfterAllFormsClose AfterAllFormsClose AfterAllFormsClose AfterAllFormsClose 1

仅在最后一个窗体关闭之后关闭。Shut down only after the last form closes.

AfterMainFormCloses AfterMainFormCloses AfterMainFormCloses AfterMainFormCloses 0

在主窗体关闭之后关闭。Shut down when the main form closes.

注解

可以设置应用程序的关闭模式ShutdownStyle属性。You can set the shutdown mode for an application through the ShutdownStyle property. 默认情况下OnMainFormClosed方法检查的值ShutdownStyle属性来确定该应用程序应关闭。By default, the OnMainFormClosed method checks the value of the ShutdownStyle property to determine if the application should shut down.

适用于

另请参阅