ClickedEventArgs.Source property

Office 2013 and later

Gets an XPathNavigator object positioned at the innermost XML node of the form's underlying XML document that contains the Button control.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

public abstract XPathNavigator Source { get; }

Property value

Type: System.Xml.XPath.XPathNavigator
An XPathNavigator object positioned at the innermost XML node of the form's underlying XML document that contains the Button control.

After you have set a reference to the XPathNavigator object that the Source property returns, you can use the properties and methods that are supported by the XPathNavigator class.

In the following example, the Source property is used to return an XPathNavigator object, which is then used to display the of the innermost XML node of the form's underlying XML document that contains the Button control.

MessageBox.Show(e.Source.OuterXml.ToString());
Show: