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 視窗。

適用於