DocumentList.OnSelectedDirectoryChanged Method

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

Raises the SelectedDirectoryChanged event.

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

Syntax

'Declaration
Protected Overridable Sub OnSelectedDirectoryChanged ( _
    e As EventArgs _
)
'Usage
Dim e As EventArgs

Me.OnSelectedDirectoryChanged(e)
protected virtual void OnSelectedDirectoryChanged(
    EventArgs e
)
protected:
virtual void OnSelectedDirectoryChanged(
    EventArgs^ e
)
abstract OnSelectedDirectoryChanged : 
        e:EventArgs -> unit 
override OnSelectedDirectoryChanged : 
        e:EventArgs -> unit 

Parameters

Remarks

The SelectedDirectoryChanged event occurs when a folder is selected in a DocumentList control.

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

The OnSelectedDirectoryChanged 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 OnSelectedDirectoryChanged in a derived class, be sure to call the base class’s OnSelectedDirectoryChanged method so that registered delegates receive the event.

Examples

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

' Handle the SelectedDirectoryChanged
' event with code that sets the correct  
' path for opening and closing files.
Private Sub DocList_SelectedDirectoryChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles DocumentList1.SelectedDirectoryChanged

    StatusBar1.Text = "Folder: " & DocumentList1.SelectedDirectory
    ' Add code to access the selected folder to open and close files.    

End Sub
private void OnFolderSel(object obj, EventArgs eventg)
{
    statusBar1.Text = "Folder: " + DocList.SelectedDirectory;

    // Add code to access the selected folder to open and close files.
}

.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