Context Leave

The ContextLeave event handler enables you to take action when you leave the context of an XMLNode control. Perhaps you might like to remove the control that was added to the actions pane when the context was entered as soon as you leave the context of the XMLNode control. This is shown in Listing 6.31.

Listing 6.31. Removing the MonthCalendar control from the actions pane when you exit the context of an XMLNode

Private Sub SampleNameNode_ContextLeave(ByVal sender As _ Object, ByVal e As Microsoft.Office.Tools.Word _ .ContextChangeEventArgs) Handles _ SampleNameNode.ContextLeave

Me.ActionsPane.Controls.Remove(calendar)

End Sub

0 0

Post a comment