Edit

Share via


WindowsCollection Interface

Definition

Contains a WindowObject object for each Microsoft Office InfoPath 2003 window that is currently open.

public interface class WindowsCollection : Microsoft::Office::Interop::InfoPath::Windows
[System.Runtime.InteropServices.Guid("096CD58B-0786-11D1-95FA-0080C78EE3BB")]
public interface WindowsCollection : Microsoft.Office.Interop.InfoPath.Windows
type WindowsCollection = interface
    interface Windows
Public Interface WindowsCollection
Implements Windows
Derived
Attributes
Implements

Examples

In the following example, implemented as an OnClick event handler for a button on a form, the Windows property of the Application object is used to set a reference to the WindowsCollection collection. The code then loops through the collection and displays the type of each Window object that it contains.

public void ShowWindowTypes_OnClick(DocActionEvent e)
{
// Set a reference to the Windows collection.
<span class="label">WindowsCollection</span> windows = thisApplication.Windows;

// Loop through the collection and display the type
// of each Window object that it contains.
for (int i=0; i &lt; windows.Count; i++)
 {
string windowType = "";

switch (windows[i].WindowType)
    {
    case XdWindowType.xdEditorWindow:
    windowType = "Editing window";
    break;

    case XdWindowType.xdDesignerWindow:
    windowType = "Designing window";
    break;
    }

thisXDocument.UI.Alert("Window type " + i + ": " + windowType);
 }
}

For code examples, see How to: Work with Form Windows.

Remarks

This type is a wrapper for a COM interface implemented by a coclass that is required by managed code for COM interoperability. To access the members specified by this interface, use the type that wraps the coclass that implements this interface. For information about that type, including usage, remarks, and examples, seeWindows.

WindowObject objects represent the two types of windows that are used in the InfoPath application: the editing window that is used as the form area when a user fills out a form, and the designing window that is used as the design mode when a user designs a form.

The WindowsCollection collection implements properties that can be used to access a form's associated Window objects, and it is accessible through the Windows property of the Application object.

Note: The WindowsCollection collection can be used only to get the count of WindowObject objects that it contains or to return a reference to a specified WindowObject object. It cannot be used to create, add, or remove WindowObject objects.

Properties

Count

Gets a count of the number of WindowObject objects contained in the WindowsCollection collection.

(Inherited from Windows)
Item[Object]

Gets a reference to the specified WindowObject object from WindowsCollection collection.

(Inherited from Windows)

Methods

GetEnumerator()

Gets an IEnumerator that iterates over all entries in the WindowsCollection object.

(Inherited from Windows)

Applies to