Selection Event

Topic Last Modified: 2006-06-13

The Selection Event is used to return information on the node in the TreeView control that is currently selected to the consuming application.

Applies To

ExchangeTreeViewControl Class

Event Data

The event handler receives a ControlGeneratedEventArgs object as an argument containing data related to this event. The following properties provide information specific to this event.

Property Description

DisplayName Property

The display name of the selected folder.

InDrag Property

Specifies whether the TreeView control is currently in drag-drop mode.

RootUri Property

The root Uniform Resource Identifier (URI) of the selected folder.

Uri Property

The URI of the selected folder.

Examples

Visual Basic .NET

The following is an example of a Selection event handler in Microsoft® Visual Basic® .NET.

Private Sub OnSelection(ByVal o As Object, ByVal e As EventArgs) Handles treeView.Selection

     ' Declare the SelectionEventArgs object.
     Dim evtArgs As SelectionEventArgs

     ' Cast e to a SelectionEventArgs object.
     evtArgs = CType(e, SelectionEventArgs)

     Debug.WriteLine("Selected folder display name: " + evtArgs.DisplayName)
     Debug.WriteLine("Control is in drag-drop mode: " + evtArgs.InDrag)
     Debug.WriteLine("Selected folder root uri: " + evtArgs.RootUri)
     Debug.WriteLine("Selected folder uri: " + evtArgs.Uri)

End Sub

C#

The following is an example of a Selection event handler in Microsoft C#.

void OnSelection(object o, EventArgs e )
{
     // Cast e to a SelectionEventArgs object.
     SelectionEventArgs evtArgs = (SelectionEventArgs)e;

     Debug.WriteLine("Selected folder display name: " + evtArgs.DisplayName);
     Debug.WriteLine("Control is in drag-drop mode: " + evtArgs.InDrag);
     Debug.WriteLine("Selected folder root uri: " + evtArgs.RootUri);
     Debug.WriteLine("Selected folder uri: " + evtArgs.Uri);

}