Form.OnClosing(CancelEventArgs) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
주의
Form.OnClosing, Form.OnClosed and the corresponding events are obsolete. Use Form.OnFormClosing, Form.OnFormClosed, Form.FormClosing and Form.FormClosed instead.
Closing 이벤트를 발생시킵니다.
protected:
virtual void OnClosing(System::ComponentModel::CancelEventArgs ^ e);
protected virtual void OnClosing(System.ComponentModel.CancelEventArgs e);
[System.Obsolete("Form.OnClosing, Form.OnClosed and the corresponding events are obsolete. Use Form.OnFormClosing, Form.OnFormClosed, Form.FormClosing and Form.FormClosed instead.", false, DiagnosticId="WFDEV004", UrlFormat="https://aka.ms/winforms-warnings/{0}")]
protected virtual void OnClosing(System.ComponentModel.CancelEventArgs e);
abstract member OnClosing : System.ComponentModel.CancelEventArgs -> unit
override this.OnClosing : System.ComponentModel.CancelEventArgs -> unit
[<System.Obsolete("Form.OnClosing, Form.OnClosed and the corresponding events are obsolete. Use Form.OnFormClosing, Form.OnFormClosed, Form.FormClosing and Form.FormClosed instead.", false, DiagnosticId="WFDEV004", UrlFormat="https://aka.ms/winforms-warnings/{0}")>]
abstract member OnClosing : System.ComponentModel.CancelEventArgs -> unit
override this.OnClosing : System.ComponentModel.CancelEventArgs -> unit
Protected Overridable Sub OnClosing (e As CancelEventArgs)
매개 변수
이벤트 데이터를 포함하는 A CancelEventArgs 입니다.
- 특성
설명
Caution
메서드는 OnClosing 사용되지 않습니다. 대신 메서드를 OnFormClosing 사용합니다.
이벤트를 발생시키는 경우 대리자를 통해 이벤트 처리기가 호출됩니다. 자세한 내용은 이벤트 처리 및 발생을 참조하세요.
또한 이 OnClosing 메서드를 사용하면 파생 클래스가 대리자를 연결하지 않고도 이벤트를 처리할 수 있습니다. 이 메서드를 재정의하는 것은 파생 클래스에서 이벤트를 처리하는 데 선호되는 기술입니다.
Caution
애플리케이션을 OnClosed 종료하기 위해 메서드를 호출할 OnClosing 때 및 Application.Exit 메서드가 호출되지 않습니다. 이러한 메서드 중 하나에서 실행해야 하는 유효성 검사 코드가 있는 경우 메서드를 호출하기 전에 열려 있는 각 양식에 대한 메서드를 Form.Close 개별적으로 호출 Exit 해야 합니다.
상속자 참고
파생 클래스에서 재정의하는 OnClosing(CancelEventArgs) 경우 등록된 대리자가 이벤트를 받도록 기본 클래스의 OnClosing(CancelEventArgs) 메서드를 호출해야 합니다.