Window.OwnedWindows 属性

定义

获取此窗口所拥有的窗口的集合。

public:
 property System::Windows::WindowCollection ^ OwnedWindows { System::Windows::WindowCollection ^ get(); };
public System.Windows.WindowCollection OwnedWindows { get; }
member this.OwnedWindows : System.Windows.WindowCollection
Public ReadOnly Property OwnedWindows As WindowCollection

属性值

WindowCollection

一个 WindowCollection,包含对此窗口所拥有的窗口的引用。

示例

下面的示例演示如何枚举 OwnedWindows

foreach (Window ownedWindow in this.OwnedWindows)
{
    Console.WriteLine(ownedWindow.Title);
}
For Each ownedWindow As Window In Me.OwnedWindows
    Console.WriteLine(ownedWindow.Title)
Next ownedWindow

注解

拥有的窗口是一个具有对另一个窗口(称为所有者窗口)的引用设置的属性 Owner 。 若要查找所有者窗口拥有的所有窗口,可以枚举 WindowCollection 属性返回 OwnedWindows 的窗口。

适用于