LoadingEventArgs.SetDefaultView method (ViewInfo)

Sets the default view of the form by specifying a ViewInfo object.

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

Syntax

'Declaration
Public MustOverride Sub SetDefaultView ( _
    view As ViewInfo _
)
'Usage
Dim instance As LoadingEventArgs
Dim view As ViewInfo

instance.SetDefaultView(view)
public abstract void SetDefaultView(
    ViewInfo view
)

Parameters

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(Microsoft.Office.InfoPath.ViewInfo) method is used in the Loading event handler to set the default view to the second view in the ViewInfoCollection.

public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
   e.SetDefaultView(ViewInfos[1]);
}
Public Sub FormEvents_Loading(ByVal sender As Object, _
   ByVal e As LoadingEventArgs)
   e.SetDefaultView(ViewInfos(1))
End Sub

See also

Reference

LoadingEventArgs class

LoadingEventArgs members

SetDefaultView overload

Microsoft.Office.InfoPath namespace