Edit

Share via


LoadingEventArgs.SetDefaultView Method

Definition

Overloads

SetDefaultView(ViewInfo)

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

SetDefaultView(String)

Sets the default view of the form by specifying the name of the view.

SetDefaultView(ViewInfo)

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

public:
 abstract void SetDefaultView(Microsoft::Office::InfoPath::ViewInfo ^ view);
public abstract void SetDefaultView (Microsoft.Office.InfoPath.ViewInfo view);
abstract member SetDefaultView : Microsoft.Office.InfoPath.ViewInfo -> unit
Public MustOverride Sub SetDefaultView (view As ViewInfo)

Parameters

view
ViewInfo

A ViewInfo object that specifies the view.

Exceptions

The parameter passed to this method is a null reference (Nothing in Visual Basic).

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

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

Remarks

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

Applies to

SetDefaultView(String)

Sets the default view of the form by specifying the name of the view.

public:
 abstract void SetDefaultView(System::String ^ view);
public abstract void SetDefaultView (string view);
abstract member SetDefaultView : string -> unit
Public MustOverride Sub SetDefaultView (view As String)

Parameters

view
String

The name of the view.

Exceptions

The parameter passed to this method is a null reference (Nothing in Visual Basic).

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

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

Remarks

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

Applies to