Application.Windows 属性

定义

获取对 的 WindowCollection引用。

public:
 abstract property Microsoft::Office::InfoPath::WindowCollection ^ Windows { Microsoft::Office::InfoPath::WindowCollection ^ get(); };
public abstract Microsoft.Office.InfoPath.WindowCollection Windows { get; }
member this.Windows : Microsoft.Office.InfoPath.WindowCollection
Public MustOverride ReadOnly Property Windows As WindowCollection

属性值

WindowCollection当前会话的 。

示例

在以下示例中, Show(String) 类的 MessageBox 方法用于显示使用 属性) 打开 (的窗口计数的消息框,并使用 属性) 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)

注解

设置对 WindowsCollection 类的引用后,可以使用其属性访问它包含的每个 Window 对象。

注意WindowsCollection 类型只能用于获取它包含的 Window 对象的计数或返回对 Window 对象的引用。 它不能用于添加或删除 Window 对象。

可以无限制访问此成员。

可以通过 Microsoft InfoPath Filler 中打开的表单中运行的代码访问此类型或成员。

适用于