SelectionEventHandler Delegate

 

Represents the method that handles the SelectionChange, Selected, and Deselected events of a Bookmark control.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

public delegate void SelectionEventHandler(
	Object^ sender,
	SelectionEventArgs^ e
)

Parameters

sender
Type: System::Object^

The source of the event.

e
Type: Microsoft.Office.Tools.Word::SelectionEventArgs^

A SelectionEventArgs that contains the event data.

When you create a SelectionEventHandler 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, until you remove the delegate.

The following code example adds a Bookmark control with text to the document and then creates an event handler for the Selected event. A message box is displayed when you move the cursor into the bookmark.

This example is for a document-level customization.

No code example is currently available or this language may not be supported.
Return to top
Show: