Edit

Share via


ViewInfoCollection.Item[] Property

Definition

Overloads

Item[Int32]

Gets the specified ViewInfo object from the ViewInfoCollection collection by index value.

Item[String]

Gets the specified ViewInfo object from the ViewInfoCollection collection by name.

Item[Int32]

Gets the specified ViewInfo object from the ViewInfoCollection collection by index value.

public:
 abstract property Microsoft::Office::InfoPath::ViewInfo ^ default[int] { Microsoft::Office::InfoPath::ViewInfo ^ get(int index); };
public abstract Microsoft.Office.InfoPath.ViewInfo this[int index] { get; }
member this.Item(int) : Microsoft.Office.InfoPath.ViewInfo
Default Public MustOverride ReadOnly Property Item(index As Integer) As ViewInfo

Parameters

index
Int32

The zero-based index of the ViewInfo object to get.

Property Value

A ViewInfo object from the ViewInfoCollection collection that corresponds to the specified index value.

Exceptions

The specified index is out of range.

Examples

The following example sets a variable to the ViewInfo object that represents the first view in the collection.

ViewInfo firstView = this.ViewInfos[0]; Dim firstView As ViewInfo = Me.ViewInfos(0)

Remarks

The value passed for the index parameter must be a number from 0 to the value of the collection's Count property minus 1.

This member can be accessed without restrictions.

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

Applies to

Item[String]

Gets the specified ViewInfo object from the ViewInfoCollection collection by name.

public:
 abstract property Microsoft::Office::InfoPath::ViewInfo ^ default[System::String ^] { Microsoft::Office::InfoPath::ViewInfo ^ get(System::String ^ viewName); };
public abstract Microsoft.Office.InfoPath.ViewInfo this[string viewName] { get; }
member this.Item(string) : Microsoft.Office.InfoPath.ViewInfo
Default Public MustOverride ReadOnly Property Item(viewName As String) As ViewInfo

Parameters

viewName
String

The name of the ViewInfo object to get.

Property Value

A ViewInfo object from the ViewInfoCollection collection that corresponds to the specified name.

Exceptions

The specified view name doesn't exist, or a a null reference (Nothing in Visual Basic) or empty value was passed.

Examples

The following example sets a variable to the ViewInfo object with the name "View2".

ViewInfo myView = this.ViewInfos["View2"]; Dim myView As ViewInfo = Me.ViewInfos("View2")

Remarks

This member can be accessed without restrictions.

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

Applies to