Closing Parent and child windows

Posted by Krishnamanohar under C# on 10/11/2012 | Points: 10 | Views : 3801 | Status : [Member] | Replies : 1
Hi
i am Working on windows application
How to close the child window if that has a parent? &
how to close close the Both parent and child windows when i click on parent child window?
Please Help me Urgent...............................
Regards,
Krishna Manohar




Responses

Posted by: Swapnil7090 on: 10/11/2012 [Member] Starter | Points: 25

Up
0
Down
its works...
i had use this code in my wpf application...

private void WindowAllClose()
{
if (App.Current.Windows.Count > 0)
{
try
{
for (int windowInCount = App.Current.Windows.Count - 1; windowInCount >= 0; windowInCount--)
{
App.Current.Windows[windowInCount].Close();
}
}
catch (Exception ex)
{
// MessageBox.Show(ex.ToString());

// string error = ex.ToString();
// ErrorStore(error);
}
}

}

private void Window_Closed(object sender, EventArgs e)
{
WindowAllClose();
}


swapnil sawant

Krishnamanohar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response