DocumentList.DeletingDocument Event

Occurs when a file is deleted in a DocumentList control.

Namespace: Microsoft.WindowsCE.Forms
Assembly: Microsoft.WindowsCE.Forms (in microsoft.windowsce.forms.dll)

Syntax

'Declaration
Public Event DeletingDocument As DocumentListEventHandler
'Usage
Dim instance As DocumentList
Dim handler As DocumentListEventHandler

AddHandler instance.DeletingDocument, handler
public event DocumentListEventHandler DeletingDocument
public:
event DocumentListEventHandler^ DeletingDocument {
    void add (DocumentListEventHandler^ value);
    void remove (DocumentListEventHandler^ value);
}
/** @event */
public void add_DeletingDocument (DocumentListEventHandler value)

/** @event */
public void remove_DeletingDocument (DocumentListEventHandler value)
JScript supports the use of events, but not the declaration of new ones.

Remarks

The DocumentList control raises this event when a file is deleted so that you can close the file, if necessary. Use the Path property to get the path to the file.

For more information about handling events, see Consuming Events.

Example

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

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Platforms

Windows Mobile for Pocket PC

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

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

DocumentList Class
DocumentList Members
Microsoft.WindowsCE.Forms Namespace