Windows property

Application.Windows property

Office 2013 and later

Gets a reference to the WindowCollection.

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

public abstract WindowCollection Windows { get; }

Property value

Type: Microsoft.Office.InfoPath.WindowCollection
A WindowCollection for the current session.

After you have set a reference to the WindowsCollection class, you can use its properties to access each of the Window objects that it contains.

NoteNote

The WindowsCollection type can be used only to get the count of the Window objects that it contains or to return a reference to a Window object. It cannot be used to add or remove Window objects.

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.

In the following example, the Show method of the MessageBox class is used to display message boxes with the count of windows open (using the Count property) and the caption of the first window in the collection (using the Caption property).

int windowCount = this.Application.Windows.Count;
Window myWindow = this.Application.Windows[0];
MessageBox.Show ("Count: " + windowCount.ToString());
MessageBox.Show("Caption: " + myWindow.Caption);
Show:
© 2016 Microsoft