LoadingEventArgs.SetDefaultView Method (String)
Sets the default view of the form by specifying the name of the view.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)
Syntax
'Declaration
'Usage
Parameters
- view
The name of the view.
Exceptions
Exception type | Condition |
---|---|
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 type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.
Example
In the following example, the SetDefaultView(System.String) method is used in the Loading event handler to set the default view to the view named "View2".
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
e.SetDefaultView("View2");
}
Public Sub FormEvents_Loading(ByVal sender As Object, _
ByVal e As LoadingEventArgs)
e.SetDefaultView("View2")
End Sub
See Also
Reference
LoadingEventArgs Class
LoadingEventArgs Members
Microsoft.Office.InfoPath Namespace