次の方法で共有


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 を操作する」を参照してください。

注釈

この型は、COM の相互運用性を得るためにマネージ コードが必要とするコクラスのラッパーです。 このインターフェイスによって指定されたメンバにアクセスするには、このインターフェイスを実装するコクラスをラップする型を使用します。 使用法、備考、例など、その種類の詳細については、「」を参照してくださいWindows

WindowObject オブジェクトは、InfoPath アプリケーションで使用される 2 種類のウィンドウを表します。1 つは、ユーザーがフォームに入力するときにフォーム領域として使用される編集ウィンドウ、もう 1 つはユーザーがフォームをデザインするときにデザイン モードとして使用されるデザイン ウィンドウです。

WindowsCollection コレクションは、フォームに関連付けられている Window オブジェクトにアクセスするために使用できるプロパティを実装しており、オブジェクトの Application プロパティをWindows使用してアクセスできます。

: WindowsCollection コレクションは、含まれている WindowObject オブジェクトの数を取得する場合、または指定した WindowObject オブジェクトへの参照を返す場合にのみ使用できます。 WindowObject オブジェクトの作成、追加、または削除には使用できません。

プロパティ

Count

コレクションに含まれるオブジェクトの WindowObject 数を WindowsCollection 取得します。

(継承元 Windows)
Item[Object]

コレクションからWindowsCollection指定したオブジェクトへの参照を取得しますWindowObject

(継承元 Windows)

メソッド

GetEnumerator()

オブジェクト内のすべてのエントリを反復処理する IEnumeratorWindowsCollection 取得します。

(継承元 Windows)

適用対象