PrintPreviewDialog.OnClosing(CancelEventArgs) PrintPreviewDialog.OnClosing(CancelEventArgs) PrintPreviewDialog.OnClosing(CancelEventArgs) PrintPreviewDialog.OnClosing(CancelEventArgs) Method

定义

引发 Closing 事件。Raises the Closing event.

protected:
 override void OnClosing(System::ComponentModel::CancelEventArgs ^ e);
protected override void OnClosing (System.ComponentModel.CancelEventArgs e);
override this.OnClosing : System.ComponentModel.CancelEventArgs -> unit
Protected Overrides Sub OnClosing (e As CancelEventArgs)

参数

e
CancelEventArgs CancelEventArgs CancelEventArgs CancelEventArgs

为可取消的事件提供数据。Provides data for a cancelable event.

注解

此方法与此类无关。This method is not relevant for this class.

OnClosing方法会使预览无效, 因此在对话框重新打开时重新生成。The OnClosing method invalidates the preview so it is regenerated when the dialog is reopened.

引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关详细信息, 请参阅处理和引发事件For more information, see Handling and Raising Events.

OnClosing 方法还允许派生类对事件进行处理而不必附加委托。The OnClosing method also allows derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.

继承者说明

当在OnClosing(CancelEventArgs)派生类中重写时, 请确保调用基类的OnClosing(CancelEventArgs)方法, 以便注册的委托接收事件。When overriding OnClosing(CancelEventArgs) in a derived class, be sure to call the base class' OnClosing(CancelEventArgs) method so that registered delegates receive the event.

适用于