ViewInfoCollection.SwitchView Method (ViewInfo)
Switches the current view to the view represented by the specified ViewInfo object.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)
Syntax
'Declaration
'Usage
Parameters
- view
The ViewObject that represents the view to switch to.
Exceptions
Exception type | Condition |
---|---|
The SwitchView method was called from an event handler for the Loading or ViewSwitched events. |
|
The parameter passed to this method is null. |
|
The parameter passed to this method isnot valid. For example, it is of the wrong type or format. |
Remarks
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.
Example
The following example switches the current view to the initial view in the ViewInfoCollection collection using the Initial property to get the ViewInfo object that represents the initial view in the collection.
ViewInfo firstView = ViewInfos.Initial;
this.ViewInfos.SwitchView(firstView);
Dim firstView As ViewInfo = ViewInfos.Initial
Me.ViewInfos.SwitchView(firstView)
See Also
Reference
ViewInfoCollection Class
ViewInfoCollection Members
Microsoft.Office.InfoPath Namespace