How to: Get all Windows in an Application
This example shows how to get all Window objects in an application.
Example
Every instantiated Window object, whether visible or not, is automatically added to a collection of window references that is managed by Application, and exposed from Windows.
You can enumerate Windows to get all instantiated windows using the following code:
foreach( Window window in Application.Current.Windows ) {
Console.WriteLine(window.Title);
}
For Each window As Window In Application.Current.Windows
Console.WriteLine(window.Title)
Next window
Samarbeid med oss på GitHub
Du finner kilden for dette innholdet på GitHub. Der du også kan opprette og se gjennom problemer og pull-forespørsler. Hvis du vil ha mer informasjon, kan du se vår bidragsyterveiledning.
.NET Desktop feedback