Export (0) Print
Expand All

DocumentListEventHandler Delegate

Represents the method that will handle the DocumentActivated event, DeletingDocument event, or SelectedDirectoryChanged event of a DocumentList.

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

public delegate void DocumentListEventHandler (
	Object sender,
	DocumentListEventArgs e
/** @delegate */
public delegate void DocumentListEventHandler (
	Object sender, 
	DocumentListEventArgs e
Not applicable.



When you create a DocumentListEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see Events and Delegates.

In Visual Basic, you do not need to create an instance of a delegate to handle an event. At design time, you can declare the event source with the WithEvents modifier and add a Handles clause to the method that handles the event. However, if you want to want to start and stop event handling at run time, you must create a delegate and pass it to the AddHandler statement.

The following code example sets the delegate for the DeletingDocument event. This code example is part of a larger example provided for the DocumentList class.

// Create an instance of the event handler delegate
// using a reference to the OnDocActivated method,
// which handles the DocumentActivated event.
// Add the delegate instance to the DocumentActivated event.
DocList.DocumentActivated +=
   new DocumentListEventHandler(this.OnDocActivated);

Windows Mobile for Pocket PC

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Compact Framework

Supported in: 2.0

Community Additions

© 2015 Microsoft