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.

适用于

另请参阅