CloseReason CloseReason CloseReason CloseReason Enum

定义

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

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

字段

ApplicationExitCall ApplicationExitCall ApplicationExitCall ApplicationExitCall 6

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

FormOwnerClosing FormOwnerClosing FormOwnerClosing FormOwnerClosing 5

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

MdiFormClosing MdiFormClosing MdiFormClosing MdiFormClosing 2

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

None None None None 0

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

TaskManagerClosing TaskManagerClosing TaskManagerClosing TaskManagerClosing 4

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

UserClosing UserClosing UserClosing UserClosing 3

用户正在通过用户界面 (UI) 关闭该窗体,例如通过单击窗体窗口上的“关闭”按钮,通过选择窗口控制菜单上的“关闭”按钮,或者通过按 Alt+F4 等方式关闭。The user is closing the form through the user interface (UI), for example by clicking the Close button on the form window, selecting Close from the window's control menu, or pressing ALT+F4.

WindowsShutDown WindowsShutDown WindowsShutDown WindowsShutDown 1

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

注解

FormClosingFormClosed会引发事件时Form已关闭,通过用户操作或以编程方式。The 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.

适用于

另请参阅