ViewInfoCollection.Item property (Int32)

Office 2013 and later

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

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

public abstract ViewInfo this[
	int index
] { get; }


Type: System.Int32

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

Property value

Type: Microsoft.Office.InfoPath.ViewInfo
A ViewInfo object from the ViewInfoCollection collection that corresponds to the specified index value.


The specified index is out of range.

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.

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

ViewInfo firstView = this.ViewInfos[0];