CloseReason 枚举

定义

指定窗体关闭的原因。Specifies the reason that a form was closed.

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

字段

ApplicationExitCall 6

Exit() 类的 Application 方法被调用。The Exit() method of the Application class was invoked.

FormOwnerClosing 5

所有者窗体正在关闭。The owner form is closing.

MdiFormClosing 2

此多文档界面 (MDI) 窗体的父窗体正在关闭。The parent form of this multiple document interface (MDI) form is closing.

None 0

关闭原因未定义或者未能确定。The cause of the closure was not defined or could not be determined.

TaskManagerClosing 4

Microsoft Windows 任务管理器正在关闭应用程序。The Microsoft Windows Task Manager is closing the application.

UserClosing 3

可以编程方式关闭窗体,也可使用用户界面中的用户操作(例如单击窗体窗口上的“关闭”按钮,选择窗口控制菜单上的“关闭”按钮,或者按 Alt+F4 等)关闭。The form is closing either programmatically or through a user action in the user interface (for example, by clicking the Close button on the form window, selecting Close from the window's control menu, or pressing ALT+F4).

WindowsShutDown 1

操作系统正在关闭所有应用程序以便准备关机。The operating system is closing all applications before shutting down.

注解

当通过FormClosed用户操作或以编程Form方式关闭时, 将引发和事件。FormClosingThe FormClosing and FormClosed events are raised when a Form is closed, either through user action or programmatically. 这些事件的处理程序分别接收类型FormClosingEventArgsFormClosedEventArgs和的参数。Handlers for these events receive parameters of type FormClosingEventArgs and FormClosedEventArgs, respectively. 这两个事件参数类都使用CloseReason枚举。Both of these event argument classes use the CloseReason enumeration.

适用于

另请参阅