共用方式為


DocumentList.DeletingDocument 事件

DocumentList 控制項中刪除檔案時發生。

命名空間:  Microsoft.WindowsCE.Forms
組件:  Microsoft.WindowsCE.Forms (在 Microsoft.WindowsCE.Forms.dll 中)

語法

'宣告
Public Event DeletingDocument As DocumentListEventHandler
'用途
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);
}
JScript 不支援事件。

備註

刪除檔案時,DocumentList 控制項會引發此事件,因此您可依需要關閉檔案。使用 Path 屬性以取得檔案的路徑。

如需處理事件的詳細資訊,請參閱使用事件

範例

下列程式碼範例示範處理 DeletingDocument 事件的方法。這個程式碼範例是 DocumentList 類別完整範例的一部分。

' 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.
}

使用權限

平台

Windows Mobile for Pocket PC

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Compact Framework

支援版本:3.5、2.0

請參閱

參考

DocumentList 類別

DocumentList 成員

Microsoft.WindowsCE.Forms 命名空間