Share via


ViewInfoCollection.Item property (String)

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

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

Syntax

'Declaration
Public MustOverride ReadOnly Default Property Item ( _
    viewName As String _
) As ViewInfo
    Get
'Usage
Dim instance As ViewInfoCollection
Dim viewName As String
Dim value As ViewInfo

value = instance(viewName)
public abstract ViewInfo this[
    string viewName
] { get; }

Parameters

  • viewName
    Type: System.String

    The name 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 name.

Exceptions

Exception Condition
ArgumentException

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

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.

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")

See also

Reference

ViewInfoCollection class

ViewInfoCollection members

Item overload

Microsoft.Office.InfoPath namespace