Application.Windows プロパティ
WindowCollection への参照を取得します。
名前空間: Microsoft.Office.InfoPath
アセンブリ: Microsoft.Office.InfoPath (Microsoft.Office.InfoPath.dll)
構文
'宣言
Public MustOverride ReadOnly Property Windows As WindowCollection
Get
'使用
Dim instance As Application
Dim value As WindowCollection
value = instance.Windows
public abstract WindowCollection Windows { get; }
プロパティ値
型: Microsoft.Office.InfoPath.WindowCollection
現在のセッションの WindowCollection。
解説
WindowsCollection クラスへの参照を設定すると、そのプロパティを使用して、含まれる各 Window オブジェクトにアクセスできます。
注意
WindowsCollection 型は、含まれる Window オブジェクトの数を取得するか、Window オブジェクトへの参照を返すためにのみ使用できます。Window オブジェクトを追加または削除するためには使用できません。
このメンバーには、制約なしでアクセスできます。
この型またはメンバーには、Microsoft InfoPath Filler で開かれたフォームを実行中のコードからのみアクセスできます。
例
次の例では、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)