次の方法で共有


Application.Windows プロパティ

WindowCollection への参照を取得します。

名前空間: Microsoft.Office.InfoPath
アセンブリ: Microsoft.Office.InfoPath (microsoft.office.infopath.dll 内)

構文

'宣言
Public MustOverride ReadOnly Property Windows As WindowCollection
'使用
Dim instance As Application
Dim value As WindowCollection

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

プロパティ値

現在のセッションの WindowCollection

コメント

WindowsCollection クラスへの参照を設定すると、そのプロパティを使用して、含まれる各 Window オブジェクトにアクセスできます。

メモメモ :

WindowsCollection 型は、含まれる Window オブジェクトの数を取得するか、Window オブジェクトへの参照を返すためにのみ使用できます。Window オブジェクトを追加または削除するためには使用できません。

このメンバは制限なしでアクセスできます。

この型またはメンバは、Microsoft Office InfoPath 2007 で開いているフォームで実行されているコードからのみアクセスできます。

次の例では、MessageBox クラスの Show メソッドを使用して、開かれているウィンドウの数を示すメッセージ ボックスを表示し (Count プロパティを使用)、コレクションの最初のウィンドウのキャプションを表示します (Caption プロパティを使用)。

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)

関連項目

参照

Application クラス
Application のメンバ
Microsoft.Office.InfoPath 名前空間