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
Public MustOverride Sub SetDefaultView ( _
view As String _
)
'Usage
Dim instance As LoadingEventArgs
Dim view As String
instance.SetDefaultView(view)
public abstract void SetDefaultView(
string view
)
Parameters
view
Type: System.StringThe name of the view.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The parameter passed to this method is a null reference (Nothing in Visual Basic). |
ArgumentException | The parameter passed to this method is not 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 InfoPath Filler or in a Web browser.
Examples
In the following code 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