Application.Windows Property

Gets a reference to the WindowCollection.

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

Syntax

'Declaration
Public MustOverride ReadOnly Property Windows As WindowCollection
    Get
'Usage
Dim instance As Application
Dim value As WindowCollection

value = instance.Windows
public abstract WindowCollection Windows { get; }

Property Value

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

Remarks

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.

Note

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.

Examples

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);
Dim windowCount As Integer = Me.Application.Windows.Count
Dim myWindow As Window  = Me.Application.Windows(0)
MessageBox.Show ("Count: " & windowCount.ToString())
MessageBox.Show("Caption: " & myWindow.Caption)

See Also

Reference

Application Class

Application Members

Microsoft.Office.InfoPath Namespace