I want to close all opened Forms which are child's of a WPF window.
WindowCollection windCollect = this.OwnedWindows;
foreach (Window wind in windCollect)
wind.Close();
It will close all WPF windows, but i need to close Forms also. Someone please help.

Tom MohanRank #912 · 2.3K reputationPosted Apr 15, 2015, 10:09 PM EDT
If you want to terminate an application with all windows, you can call
App.Current.Shutdown();. If you want call this on closing of any window, register to the Window.Closed event and callApp.Current.Shutdown();there in.Through App.Current.Windows you have access to all Window-instances. You also can close them manually.
Prathap39 reputationPosted Apr 15, 2015, 10:16 PM EDT
I need to close child forms only , not the whole application
Akhil GargRank #772 · 3K reputationPosted Apr 17, 2015, 10:12 AM EDT
foreach (Form f in Application.OpenForms) { f.Close(); } try this.