Microsoft Office Tutorials and References
In Depth Information
Using events in InfoPath
View
The View class represents the view (appearance) of the InfoPath form. The View class
provides the ViewInfo property, which allows you to access information about the
associated view. The ForceUpdate method is one of the most useful methods, and
updates the current view programmatically.
// Reference to InfoPath View class and reading the CurrentView
property
Microsoft.Office.InfoPath.View InfoPathView = this.CurrentView;
// Reading the Caption of the current view
InfoPathView.ViewInfo.Caption.ToString();
ViewInfoCollection
The ViewInfoCollection object for an InfoPath form can be accessed through the
ViewInfos property of the XmlForm class. The ViewInfoCollection class contains
a ViewInfo object for each view within a form. Also, the ViewInfoCollection class
implements properties that can be used to access the ViewInfo object associated with
each view in a form. For example, the CurrentView property returns a View object
that describes the current view of the InfoPath form.
// Referencing the ViewInfoCollection class of InfoPath form
ViewInfoCollection ReadViewInformation = this.ViewInfos;
// Reading through the properties of the variable ReadViewInformation
ReadViewInformation.Default.Name.ToString();
Using events in InfoPath
The events available to InfoPath developers in Microsoft InfoPath 2007 are different
from the events available to other technology forms developers. For example,
the InfoPath hosted control, provided by the InfoPath event manager, gives the
developers of third-party hosted applications the ability to respond to events
defined in the form. The InfoPath event manager provides this functionality.
Event names are case sensitive, unlike those in HTML or XHTML forms.
InfoPath 2007 events can be classified into the following three types:
Form-level events
XML and data validation events
Control events
 
Search JabSto ::




Custom Search