ViewInfo.Name Property

Gets the name of the view that is associated with the ViewInfo object.

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

Syntax

'Declaration
Public MustOverride ReadOnly Property Name As String
    Get
'Usage
Dim instance As ViewInfo
Dim value As String

value = instance.Name
public abstract string Name { get; }

Property Value

Type: System.String
The name of the view that is associated with the ViewInfo object.

Remarks

The name of the ViewInfo object is the same as the name of the view that it represents. The name of the ViewInfo object can also be used as the argument to the Item[String] property of the ViewInfoCollection class.

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

In the following example, the Name property of the ViewInfo class is used to display the name of the first view in the ViewInfoCollection in a message box.

ViewInfo myViewInfo = this.ViewInfos[0];
MessageBox.Show("View name: " + myViewInfo.Name);
Dim myViewInfo As ViewInfo  = Me.ViewInfos(0)
MessageBox.Show("View name: " & myViewInfo.Name)

See Also

Reference

ViewInfo Class

ViewInfo Members

Microsoft.Office.InfoPath Namespace