WindowCollection.Item property

Office 2013 and later

Gets a reference to the specified Window object in the WindowCollection object.

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

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


Type: System.Int32

The zero-based index of the Window object to return.

Property value

Type: Microsoft.Office.InfoPath.Window
A Window object from the WindowCollection object that corresponds to the specified index value.

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

After you have set a reference to the Window object that the Item property returns, you can access any of its properties and methods.

This member can be accessed without restrictions.

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

Because the Item property is the default property of the WindowsCollection class, it can be used as follows.

Window firstWindow = this.Application.Windows[0];