Share via


InfoPathControl.Uninit method

Defines a method that must be provided by the developer to perform any clean up routines that are required before an instance of the control is removed from a view.

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

Syntax

'Declaration
Sub Uninit
'Usage
Dim instance As InfoPathControl

instance.Uninit()
void Uninit()

Remarks

InfoPath calls the Uninit method immediately before the control is removed from the view and destroyed. Note that because InfoPath forms make use of XSL transforms to represent views, any changes in the data or explicit calls to the object model can cause InfoPath to automatically synchronize the view with the data that is contained in a form's underlying XML document, which destroys and recreates the view. This means that ActiveX controls are likely to be created and destroyed much more often within a given session than controls in Visual Basic forms or Web forms. ActiveX controls which need to preserve state information independent of the bound data, such as the state of the scroll position, should create routines in the Init method of the control that use the SetNamedNodeProperty method to save this information, and use the GetNamedNodeProperty method to restore state information during the Init method call.

The InfoPathControl 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

InfoPathControl interface

InfoPathControl members

Microsoft.Office.Interop.InfoPath namespace