XMLNodes::ContextLeave Event
Occurs when the cursor is moved from one of the nodes or descendant nodes of the XMLNodes collection, to an area outside of the context of the original node.
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
The ContextLeave event differs from the Deselect event. The ContextLeave event is raised only when the context changes and can be raised for multiple XMLNodes controls nested at the same hierarchical level. For more information, see XMLNodes Control.
The following code example demonstrates event handlers for the Select, Deselect, ContextEnter, and ContextLeave events. When the Select and Deselect events are raised, the event handlers add double lines to the borders of the selection or remove the double lines, depending on the event. When the ContextEnter and ContextLeave events are raised, the event handlers display messages that state the names of the newly selected node and the previously selected node. This example assumes that the current document contains an XMLNodes collection named SampleInsertNodes.