WindowsCollection 接口

定义

包含 WindowObject 当前打开的每个 Microsoft Office InfoPath 2003 窗口的对象。

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
派生
属性
实现

示例

在以下示例中,作为 OnClick 窗体上按钮的事件处理程序实现, Windows 对象的 属性 Application 用于设置对 WindowsCollection 集合的引用。 后代码循环遍历该集合并显示在其中包含的每个 Window 对象的类型。

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);
 }
}

有关代码示例,请参阅如何:使用窗体 Windows。

注解

此类型是用于由 Coclass(托管代码需要此 Coclass 来实现 COM 互操作性)实现的 COM 接口的包装。 要访问由此接口指定的成员,请使用用于包装实现此接口的 Coclass 的类型。 有关该类型的信息(包括用法、备注和示例),请参阅Windows

WindowObject 对象代表在 InfoPath 应用程序中使用的两种窗口类型:用户填写表单时用作表单区域的编辑窗口,以及用户设计表单时用作设计模式的设计窗口。

WindowsCollection 集合实现可用于访问窗体关联的 Window 对象的属性,并且可通过 Windows 对象的 属性访问该Application集合。

注意WindowsCollection 集合只能用于获取它包含的 WindowObject 对象的计数或返回对指定 WindowObject 对象的引用。 它不能用于创建、添加或删除 WindowObject 对象。

属性

Count

获取集合中包含的对象数 WindowObjectWindowsCollection 计数。

(继承自 Windows)
Item[Object]

WindowsCollection集合中获取对指定WindowObject对象的引用。

(继承自 Windows)

方法

GetEnumerator()

获取一个循环访问对象中所有条目的 WindowsCollectionIEnumerator

(继承自 Windows)

适用于