Share via


InfoPathControl2.RefreshState Method

Defines a method that InfoPath calls when it must refresh the state of an instance of the control in a view.

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

Syntax

'Declaration
Sub RefreshState
'Usage
Dim instance As InfoPathControl2

instance.RefreshState()
void RefreshState()

Remarks

In InfoPath 2007, when a change occurs to the XML node the control is bound to, InfoPath calls the SaveState() method implemented by the control so that InfoPath can destroy the control, and the control can successfully restore its state when it was reconstructed. In InfoPath 2010, changes were made so that ActiveX controls are not always destroyed and reconstructed when a change to the bound XML node occurs. To fully implement this change, InfoPath 2010 needs a way to communicate to the control that a change to the bound XML node has occurred, and that the control should refresh its state by reading the updated information in the XML node. To do that, the developer of the control must implement the RefreshState() method on the control.

The InfoPathControl2 and InfoPathControlSite objects and their methods and properties are designed to be used only from the implementation of an ActiveX control. These objects and their members are not supported in InfoPath form code. For more information on how to create ActiveX controls that work with InfoPath, see the InfoPath Developer Center (https://msdn.microsoft.com/infopath).

See Also

Reference

InfoPathControl2 Interface

InfoPathControl2 Members

Microsoft.Office.Interop.InfoPath Namespace