WindowsCollection インターフェイス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
WindowObject現在開いている各 Microsoft InfoPath ウィンドウのオブジェクトが含まれます。
public interface class WindowsCollection : Microsoft::Office::Interop::InfoPath::SemiTrust::Windows
[System.Runtime.InteropServices.Guid("096cd58b-0786-11d1-95fa-0080c78ee3bb")]
public interface WindowsCollection : Microsoft.Office.Interop.InfoPath.SemiTrust.Windows
type WindowsCollection = interface
interface Windows
Public Interface WindowsCollection
Implements Windows
- 属性
- 実装
例
次の例では、フォーム上のボタンのイベント ハンドラーとして OnClick 実装され、 Windows オブジェクトの プロパティを Application 使用して 、WindowsCollection コレクションへの参照を設定します。 次に、このコードは、コレクション全体をループ処理し、そのコレクション内の各 Window オブジェクトの種類を表示します。
[InfoPathEventHandler(MatchPath="ShowWindowTypes", EventType=InfoPathEventType.OnClick)]
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 < 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);
}
}
コード例については、「[方法] InfoPath 2003 オブジェクト モデルを使用してフォーム ウィンドウを操作する方法」を参照してください。
注釈
この型は、COM の相互運用性を得るためにマネージ コードが必要とするコクラスのラッパーです。 この型を使用して、このコクラスによって実装される COM インターフェイスにアクセスします。 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() |
オブジェクト内のすべてのエントリを反復処理する IEnumerator を WindowsCollection 取得します。 (継承元 Windows) |