Share via


DocumentList.OnDeletingDocument Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Raises the DeletingDocument event.

Namespace:  Microsoft.WindowsCE.Forms
Assembly:  Microsoft.WindowsCE.Forms (in Microsoft.WindowsCE.Forms.dll)

Syntax

'Declaration
Protected Overridable Sub OnDeletingDocument ( _
    e As DocumentListEventArgs _
)
'Usage
Dim e As DocumentListEventArgs

Me.OnDeletingDocument(e)
protected virtual void OnDeletingDocument(
    DocumentListEventArgs e
)
protected:
virtual void OnDeletingDocument(
    DocumentListEventArgs^ e
)
abstract OnDeletingDocument : 
        e:DocumentListEventArgs -> unit 
override OnDeletingDocument : 
        e:DocumentListEventArgs -> unit 

Parameters

Remarks

The DeletingDocument event occurs when a file is deleted with a DocumentList control.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The OnDeletingDocument 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.

Notes to Inheritors

When overriding OnDeletingDocument in a derived class, be sure to call the base class’s OnDeletingDocument method so that registered delegates receive the event.

Examples

The following code example shows a method that handles the DeletingDocument event. This code example is part of a larger example provided for the DocumentList class.

' Handle the DeletingDocument 
' event with code to close the file.
 Private Sub DocList_DeletingDocument(ByVal sender As Object, _
 ByVal docevent As Microsoft.WindowsCE.Forms.DocumentListEventArgs) _
 Handles DocumentList1.DeletingDocument

     StatusBar1.Text = "Deleted: " & docevent.Path
     ' Add code to close any instances of the file.
 End Sub
private void OnDelDoc(object obj, DocumentListEventArgs docg)
{
    statusBar1.Text += "Deleted: " + docg.Path;

    // Add code to close any instances of the file.
}

.NET Framework Security

Platforms

Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0

See Also

Reference

DocumentList Class

DocumentList Members

Microsoft.WindowsCE.Forms Namespace