Export (0) Print
Expand All

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)

public abstract void SetDefaultView(
	ViewInfo view
)

Parameters

view
Type: Microsoft.Office.InfoPath.ViewInfo

A ViewInfo object that specifies the view.

ExceptionCondition
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.

This type or member can be accessed from code running in forms opened in Microsoft InfoPath Filler or in a Web browser.

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]);
}
Show:
© 2014 Microsoft